Versions in this module Expand all Collapse all v2 v2.4.1 Apr 2, 2024 Changes in this version + func IsCloseError(err error, codes ...int) bool + type CallbackStream struct + func (s *CallbackStream) Close() + func (s *CallbackStream) Read(args ...interface{}) error + type Client struct + func NewClient(hub string, conn *Conn) *Client + func (c *Client) Callback(ctx context.Context, method string) (*CallbackStream, error) + func (c *Client) Close() error + func (c *Client) Invoke(ctx context.Context, method string, args ...interface{}) *Invocation + func (c *Client) Run(ctx context.Context) error + type ClientMsg struct + Args []json.RawMessage + Hub string + InvocationID int + Method string + State *json.RawMessage + type CloseError struct + func (e *CloseError) Error() string + type Conn struct + func Dial(ctx context.Context, endpoint, cdata string, opts ...DialOpt) (*Conn, error) + func (c *Conn) Close() error + func (c *Conn) ReadMessage(ctx context.Context, msg *Message) error + func (c *Conn) State() *State + func (c *Conn) WriteMessage(ctx context.Context, msg ClientMsg) error + type ConnectError struct + func (e *ConnectError) Error() string + func (e *ConnectError) Unwrap() error + type DialError struct + func (e *DialError) Error() string + func (e *DialError) Unwrap() error + type DialOpt func(*config) + func Dialer(dialer WebsocketDialerFunc) DialOpt + func HTTPClient(client *http.Client) DialOpt + func Headers(headers http.Header) DialOpt + func MaxConnectRetries(retries int) DialOpt + func MaxMessageProcessDuration(duration time.Duration) DialOpt + func MaxNegotiateRetries(retries int) DialOpt + func MaxReconnectDuration(duration time.Duration) DialOpt + func MaxReconnectRetries(retries int) DialOpt + func MaxStartRetries(retries int) DialOpt + func Params(params url.Values) DialOpt + func Protocol(protocol string) DialOpt + func RetryInterval(interval time.Duration) DialOpt + type DuplicateCallbackError struct + func (e *DuplicateCallbackError) Error() string + type InvalidInitMessageError struct + func (e *InvalidInitMessageError) Error() string + type InvalidStartResponseError struct + func (e *InvalidStartResponseError) Error() string + type Invocation struct + func (r *Invocation) Exec() error + func (r *Invocation) Unmarshal(dest interface{}) error + type InvocationError struct + func (e *InvocationError) Error() string + type Message struct + Error string + ErrorDetail *map[string]interface{} + GroupsToken string + HubError bool + InvocationID int + MessageID string + Messages []ClientMsg + Result json.RawMessage + Status int + type NegotiateError struct + func (e *NegotiateError) Error() string + func (e *NegotiateError) Unwrap() error + type ProxyFunc func(req *http.Request) (*url.URL, error) + type ReadError struct + func (e *ReadError) Error() string + func (e *ReadError) Unwrap() error + type ServerMsg struct + D *json.RawMessage + E *string + H *bool + I int + R *json.RawMessage + S *json.RawMessage + T *json.RawMessage + type StartError struct + func (e *StartError) Error() string + func (e *StartError) Unwrap() error + type State struct + ConnectionData string + ConnectionID string + ConnectionToken string + GroupsToken string + MessageID string + Protocol string + type WebsocketConn interface + Close func() error + ReadMessage func(ctx context.Context) (messageType int, p []byte, err error) + WriteMessage func(ctx context.Context, messageType int, p []byte) error + type WebsocketDialer interface + Dial func(ctx context.Context, u string, headers http.Header) (conn WebsocketConn, status int, err error) + func NewDefaultDialer(client *http.Client) WebsocketDialer + type WebsocketDialerFunc func(client *http.Client) WebsocketDialer + type WriteError struct + func (e *WriteError) Error() string + func (e *WriteError) Unwrap() error