Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option struct { Protocol transport.Protocol // 通信协议 Host string // 服务端地址 SendChannelSize int // contains filtered or unexported fields }
Option 每个服务端的配置
type OptionSetter ¶
type OptionSetter func(option *Option)
OptionSetter 快速设置Option
func UseHTTP ¶
func UseHTTP(host string) OptionSetter
func UseTCP ¶
func UseTCP(host string) OptionSetter
func UseUnix ¶
func UseUnix(host string) OptionSetter
type SendChannel ¶
type SendChannel struct { Ch chan []byte // contains filtered or unexported fields }
func NewSendChannel ¶
func NewSendChannel(size int) *SendChannel
func (*SendChannel) Close ¶
func (c *SendChannel) Close()
func (*SendChannel) Send ¶
func (c *SendChannel) Send(data []byte) error
type Server ¶
type Server struct { Option *Option // 管理器配置 // contains filtered or unexported fields }
Server 服务管理器
func (Server) RegisterName ¶
func (*Server) Run ¶
func (s *Server) Run(fns ...OptionSetter) error
Click to show internal directories.
Click to hide internal directories.