Documentation
¶
Index ¶
- func Serve(opts ...Option)
- type ByteOrder
- type Option
- func WithByteOrderLittleEndian() 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 RouterOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶ added in v1.0.27
type Option func(*Options)
func WithHttpAddr ¶ added in v1.0.27
func WithHttpAddr(httpAddr string, opts ...*RouterOption) Option
WithHttpAddr sets the independent http address
func WithHttpHungup ¶ added in v1.0.32
func WithHttpHungup() Option
func WithInitializer ¶ added in v1.0.27
func WithInitializer(initializer channel.ChannelInitializer) Option
func WithLogger ¶ added in v1.0.27
func WithMsgType ¶ added in v1.0.27
func WithPacketBytesCount ¶ added in v1.0.31
消息长度占用字节数
func WithTCPAddr ¶ added in v1.0.27
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 ¶ added in v1.0.27
WithTLSConfig sets the `key` and `certificate` of TLS
func WithWriteTimeOut ¶ added in v1.0.29
连接写入消息超时时间
type Options ¶ added in v1.0.27
type Options struct { TCPAddr string HttpAddr string TLSCertificate string // crt for tls TLSKey string // key for tls Initializer channel.ChannelInitializer Logger logger.Logger RouterOptions map[string]*Options // 分组配置 (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 // 跳过包长度 }
Options contains some configurations for current node
type RouterOption ¶ added in v1.0.32
func WithRouterOption ¶ added in v1.0.32
func WithRouterOption(router string, opts ...Option) *RouterOption
Click to show internal directories.
Click to hide internal directories.