Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- func (client *Client) Close() error
- func (client *Client) CloseWithContext(ctx context.Context) error
- func (client *Client) Connection() session.Conn
- func (client *Client) Dial(ctx context.Context, wsUrl *url.URL) error
- func (client *Client) IsClosed() bool
- func (client *Client) SendMessage(message any)
- func (client *Client) SendMessages(messages ...any)
- func (client *Client) Status() uint32
- type Conn
- func (conn *Conn) AsyncWrite(buf []byte, callback func(c session.Conn, err error) error) (err error)
- func (conn *Conn) AsyncWritev(bs [][]byte, callback func(c session.Conn, err error) error) (err error)
- func (conn *Conn) Context() (ctx any)
- func (conn *Conn) Discard(n int) (discarded int, err error)
- func (conn *Conn) Flush() (err error)
- func (conn *Conn) InboundBuffered() (n int)
- func (conn *Conn) Init(client *Client, pConn *websocket.Conn) error
- func (conn *Conn) Next(n int) (buf []byte, err error)
- func (conn *Conn) OutboundBuffered() (n int)
- func (conn *Conn) Peek(n int) (buf []byte, err error)
- func (conn *Conn) Read(_ []byte) (n int, err error)
- func (conn *Conn) ReadFrom(r io.Reader) (n int64, err error)
- func (conn *Conn) SetContext(ctx any)
- func (conn *Conn) SetDeadline(t time.Time) error
- func (conn *Conn) Write(_ []byte) (n int, err error)
- func (conn *Conn) WriteTo(w io.Writer) (n int64, err error)
- func (conn *Conn) Writev(bs [][]byte) (n int, err error)
- type Option
- type Options
Constants ¶
View Source
const ( StatusInitial = iota StatusConnecting StatusConnected StatusClosed )
Variables ¶
View Source
var (
ErrInvalidStatus = errors.New("invalid client status")
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { *Options session.BaseSession // contains filtered or unexported fields }
func (*Client) Connection ¶
func (*Client) Dial ¶
Dial
@Description: 连接 @receiver client @param ctx @param address 如:127.0.0.1:9999 @return error
type Conn ¶
func (*Conn) AsyncWrite ¶
func (*Conn) AsyncWritev ¶
func (*Conn) InboundBuffered ¶
func (*Conn) OutboundBuffered ¶
func (*Conn) SetContext ¶
Click to show internal directories.
Click to hide internal directories.