Documentation ¶
Index ¶
- func NewClient(id, name string, opts ClientOptions) kim.Client
- func NewClientWithProps(id, name string, meta map[string]string, opts ClientOptions) kim.Client
- func NewConn(conn net.Conn) kim.Conn
- func NewServer(listen string, service kim.ServiceRegistration, options ...kim.ServerOption) kim.Server
- type Client
- func (c *Client) Close()
- func (c *Client) Connect(addr string) error
- func (c *Client) GetMeta() map[string]string
- func (c *Client) Read() (kim.Frame, error)
- func (c *Client) Send(payload []byte) error
- func (c *Client) ServiceID() string
- func (c *Client) ServiceName() string
- func (c *Client) SetDialer(dialer kim.Dialer)
- type ClientOptions
- type Frame
- type Upgrader
- type WsConn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClientWithProps ¶
func NewServer ¶
func NewServer(listen string, service kim.ServiceRegistration, options ...kim.ServerOption) kim.Server
NewServer NewServer
Types ¶
type Client ¶
type Client struct { sync.Mutex kim.Dialer Meta map[string]string // contains filtered or unexported fields }
Client is a websocket implement of the terminal
type ClientOptions ¶
type ClientOptions struct { Heartbeat time.Duration //登录超时 ReadWait time.Duration //读超时 WriteWait time.Duration //写超时 }
ClientOptions ClientOptions
type Frame ¶
type Frame struct {
// contains filtered or unexported fields
}
func (*Frame) GetPayload ¶
func (*Frame) SetPayload ¶
Click to show internal directories.
Click to hide internal directories.