Documentation
¶
Index ¶
- func Serve(opts ...Option)
- type ByteOrder
- type Option
- func WithByteOrderLittleEndian() Option
- func WithCustom(key string, value any) Option
- func WithHttpAddr(httpAddr string, opts ...*RouterOption) Option
- func WithHttpHungup() Option
- func WithInitializer(initializer channel.ChannelInitializer) Option
- func WithKeyLengthInclude() Option
- func WithLogger(l logger.Logger) Option
- func WithMsgType(msgType int) Option
- func WithPacketBytesCount(packetBytesCount int32) Option
- func WithReadLimit(readLimit int32) Option
- func WithReadTimeOut(readTimeOut int32) Option
- func WithSkipPacketBytesCount() Option
- func WithTCPAddr(addr string) Option
- func WithTLSConfig(certificate, key string) Option
- func WithWriteTimeOut(writeTimeOut int32) Option
- type Options
- type Router
- type RouterOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*Options)
func WithCustom ¶
func WithHttpAddr ¶
func WithHttpAddr(httpAddr string, opts ...*RouterOption) Option
WithHttpAddr sets the independent http address
func WithHttpHungup ¶
func WithHttpHungup() Option
func WithInitializer ¶
func WithInitializer(initializer channel.ChannelInitializer) Option
func WithLogger ¶
func WithMsgType ¶
func WithTCPAddr ¶
WithTCPAddr sets the listen address which is used to establish connection between cluster members. Will select an available port automatically if no member address setting and panic if no available port
func WithTLSConfig ¶
WithTLSConfig sets the `key` and `certificate` of TLS
type Options ¶
type Options struct { TCPAddr string HttpAddr string TLSCertificate string // crt for tls TLSKey string // key for tls Initializer channel.ChannelInitializer Logger logger.Logger RouterOptions []*RouterOption // 分组配置 (key:routerPath, value:options) MsgType int // WebSocket 消息类型 HttpHungup bool // Http请求是否挂起 //// param for conn ByteOrder ByteOrder // 字节序 ReadTimeOut int32 // 连接读取消息超时时间 WriteTimeOut int32 // 连接写入消息超时时间 ReadLimit int32 // 连接读取消息长度限制 PacketBytesCount int32 // 消息长度占用字节数 LengthInclude bool // 包长度是否包含自己的长度 SkipPacketBytesCount bool // 跳过包长度 //// param for custom CustomDefine map[string]any }
Options contains some configurations for current node
type RouterOption ¶
type RouterOption struct { Opts *Options // contains filtered or unexported fields }
func WithRouterOption ¶
func WithRouterOption(router Router, opts ...Option) *RouterOption
Click to show internal directories.
Click to hide internal directories.