Documentation
¶
Index ¶
- func AesDecryptECB(encrypted, key []byte) (decrypted []byte)
- func AesEncryptECB(src []byte, key []byte) (encrypted []byte)
- func AesSha1Prng(key []byte, length int) ([]byte, error)
- func EventStrings() []string
- func FrameTypeStrings() []string
- func HexMD5(src []byte) string
- func HexSha1(src []byte) (digest []byte)
- func HmacMD5(src, secret []byte) string
- func HmacSHA256(src, secret []byte) string
- func MD5(src []byte) []byte
- func Sha1(src []byte) []byte
- func StatusStrings() []string
- type BeforeReconnectHandler
- type Client
- func (c *Client) SendBinary(message []byte)
- func (c *Client) SendClose(message []byte)
- func (c *Client) SendJson(message any) error
- func (c *Client) SendMessage(message []byte)
- func (c *Client) SendPing(message []byte)
- func (c *Client) SendPong(message []byte)
- func (c *Client) Shutdown() (err error)
- func (c *Client) Status() Status
- func (c *Client) URL() string
- type DecompressHandler
- type ErrorHandler
- type Event
- type FrameType
- func (i FrameType) IsAFrameType() bool
- func (i FrameType) MarshalJSON() ([]byte, error)
- func (i FrameType) MarshalText() ([]byte, error)
- func (i FrameType) String() string
- func (i *FrameType) UnmarshalJSON(data []byte) error
- func (i *FrameType) UnmarshalText(text []byte) error
- func (FrameType) Values() []string
- type HeartbeatHandler
- type Logger
- type Message
- type OnCloseHandler
- type OnConnectedHandler
- type Option
- func WithAutoReConnect() Option[Client]
- func WithBeforeReconnect(handler BeforeReconnectHandler) Option[Client]
- func WithCloseHandler(handler OnCloseHandler) Option[Client]
- func WithCompression(compression bool) Option[Client]
- func WithCompressionLevel(level int) Option[Client]
- func WithConnectHeader(header http.Header) Option[Client]
- func WithConnectTimeout(timeout time.Duration) Option[Client]
- func WithConnected(handler OnConnectedHandler) Option[Client]
- func WithDecompressHandler(handler DecompressHandler) Option[Client]
- func WithDelayReconnect(delay time.Duration) Option[Client]
- func WithDialer(dialer websocket.Dialer) Option[Client]
- func WithErrorHandler(handler ErrorHandler) Option[Client]
- func WithHeartbeatHandler(handler HeartbeatHandler) Option[Client]
- func WithHeartbeatInterval(interval time.Duration) Option[Client]
- func WithLogger(logger *slog.Logger) Option[Client]
- func WithPingHandler(handler PingHandler) Option[Client]
- func WithPongHandler(handler PongHandler) Option[Client]
- func WithProxyURL(proxyURL string) Option[Client]
- func WithReadLimit(limit int64) Option[Client]
- func WithReadTimeout(timeout time.Duration) Option[Client]
- func WithReconnected(handler ReConnectedHandler) Option[Client]
- type PingHandler
- type PongHandler
- type ReConnectedHandler
- type ReaderReceiver
- type Receiver
- type Status
- type Unmarshaler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AesDecryptECB ¶
func AesEncryptECB ¶
func EventStrings ¶ added in v1.1.9
func EventStrings() []string
EventStrings returns a slice of all String values of the enum
func FrameTypeStrings ¶
func FrameTypeStrings() []string
FrameTypeStrings returns a slice of all String values of the enum
func HmacSHA256 ¶
func StatusStrings ¶
func StatusStrings() []string
StatusStrings returns a slice of all String values of the enum
Types ¶
type BeforeReconnectHandler ¶ added in v1.1.9
type BeforeReconnectHandler func(*Client)
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) SendBinary ¶
func (*Client) SendMessage ¶
type ErrorHandler ¶
type Event ¶ added in v1.1.9
type Event uint
func EventString ¶ added in v1.1.9
EventString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func EventValues ¶ added in v1.1.9
func EventValues() []Event
EventValues returns all values of the enum
func (Event) IsAEvent ¶ added in v1.1.9
IsAEvent returns "true" if the value is listed in the enum definition. "false" otherwise
func (Event) MarshalJSON ¶ added in v1.1.9
MarshalJSON implements the json.Marshaler interface for Event
func (Event) MarshalText ¶ added in v1.1.9
MarshalText implements the encoding.TextMarshaler interface for Event
func (*Event) UnmarshalJSON ¶ added in v1.1.9
UnmarshalJSON implements the json.Unmarshaler interface for Event
func (*Event) UnmarshalText ¶ added in v1.1.9
UnmarshalText implements the encoding.TextUnmarshaler interface for Event
type FrameType ¶
type FrameType int
func FrameTypeString ¶
FrameTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func FrameTypeValues ¶
func FrameTypeValues() []FrameType
FrameTypeValues returns all values of the enum
func (FrameType) IsAFrameType ¶
IsAFrameType returns "true" if the value is listed in the enum definition. "false" otherwise
func (FrameType) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for FrameType
func (FrameType) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface for FrameType
func (*FrameType) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for FrameType
func (*FrameType) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface for FrameType
type HeartbeatHandler ¶
type HeartbeatHandler func(*Client)
type OnCloseHandler ¶
type OnConnectedHandler ¶
type OnConnectedHandler func(*Client)
type Option ¶
type Option[T any] func(*T)
func WithAutoReConnect ¶
func WithBeforeReconnect ¶ added in v1.1.9
func WithBeforeReconnect(handler BeforeReconnectHandler) Option[Client]
func WithCloseHandler ¶
func WithCloseHandler(handler OnCloseHandler) Option[Client]
func WithCompression ¶
func WithCompressionLevel ¶
func WithConnected ¶
func WithConnected(handler OnConnectedHandler) Option[Client]
func WithDecompressHandler ¶
func WithDecompressHandler(handler DecompressHandler) Option[Client]
func WithDelayReconnect ¶ added in v1.2.1
func WithErrorHandler ¶
func WithErrorHandler(handler ErrorHandler) Option[Client]
func WithHeartbeatHandler ¶
func WithHeartbeatHandler(handler HeartbeatHandler) Option[Client]
func WithLogger ¶
WithLogger custom specify logger instance
func WithPingHandler ¶
func WithPingHandler(handler PingHandler) Option[Client]
func WithPongHandler ¶
func WithPongHandler(handler PongHandler) Option[Client]
func WithProxyURL ¶
func WithReadLimit ¶
func WithReconnected ¶
func WithReconnected(handler ReConnectedHandler) Option[Client]
type PingHandler ¶
type PongHandler ¶
type ReConnectedHandler ¶
type ReConnectedHandler func(*Client)
type ReaderReceiver ¶ added in v1.1.9
type ReaderReceiver struct{}
type Receiver ¶
type Receiver interface { Unmarshaler OnMessage(any) }
type Status ¶
type Status uint32
func StatusString ¶
StatusString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func (Status) IsAStatus ¶
IsAStatus returns "true" if the value is listed in the enum definition. "false" otherwise
func (Status) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface for Status
func (*Status) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface for Status