Documentation ¶
Index ¶
- func NewClient(opts ...ClientOption) network.Client
- func NewServer(opts ...ServerOption) network.Server
- type ClientOption
- type ServerOption
- func WithServerEnableHeartbeatCheck(enable bool) ServerOption
- func WithServerHeartbeatInterval(heartbeatInterval time.Duration) ServerOption
- func WithServerListenAddr(addr string) ServerOption
- func WithServerMaxConnNum(maxConnNum int) ServerOption
- func WithServerMaxMsgLen(maxMsgLen int) ServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient(opts ...ClientOption) network.Client
func NewServer ¶
func NewServer(opts ...ServerOption) network.Server
Types ¶
type ClientOption ¶
type ClientOption func(o *clientOptions)
func WithClientDialAddr ¶
func WithClientDialAddr(addr string) ClientOption
WithClientDialAddr 设置拨号地址
func WithClientEnableHeartbeat ¶
func WithClientEnableHeartbeat(enable bool) ClientOption
WithClientEnableHeartbeat 设置是否启用心跳间隔时间
func WithClientHeartbeatInterval ¶
func WithClientHeartbeatInterval(heartbeatInterval time.Duration) ClientOption
WithClientHeartbeatInterval 设置心跳间隔时间
func WithClientMaxMsgLen ¶
func WithClientMaxMsgLen(maxMsgLen int) ClientOption
WithClientMaxMsgLen 设置消息最大长度
type ServerOption ¶
type ServerOption func(o *serverOptions)
func WithServerEnableHeartbeatCheck ¶
func WithServerEnableHeartbeatCheck(enable bool) ServerOption
WithServerEnableHeartbeatCheck 是否启用心跳检测
func WithServerHeartbeatInterval ¶
func WithServerHeartbeatInterval(heartbeatInterval time.Duration) ServerOption
WithServerHeartbeatInterval 设置心跳检测间隔时间
func WithServerListenAddr ¶
func WithServerListenAddr(addr string) ServerOption
WithServerListenAddr 设置监听地址
func WithServerMaxConnNum ¶
func WithServerMaxConnNum(maxConnNum int) ServerOption
WithServerMaxConnNum 设置连接的最大连接数
func WithServerMaxMsgLen ¶
func WithServerMaxMsgLen(maxMsgLen int) ServerOption
WithServerMaxMsgLen 设置消息最大长度
Click to show internal directories.
Click to hide internal directories.