Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Upgrader = websocket.Upgrader{ReadBufferSize: 1024, WriteBufferSize: 1024}
)
Functions ¶
This section is empty.
Types ¶
type Breaker ¶
type Breaker interface { Register(conn *websocket.Conn) (*Client, error) UnRegister(client *Client) error BroadCast(msg Message) error MaxReadLimit() int64 }
func NewBreaker ¶
NewBreaker returns a breaker for websocket.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is websocket client.
type ErrorHandler ¶
type ErrorHandler func(error)
type OptionFunc ¶
type OptionFunc func(bk *breaker)
func WithErrorHandlerOption ¶
func WithErrorHandlerOption(f ErrorHandler) OptionFunc
WithErrorHandlerOption returns a function which sets error handler.
func WithMaxMessagePoolLength ¶
func WithMaxMessagePoolLength(length int64) OptionFunc
WithMaxMessagePoolLength returns a function that sets a pool size, which how many data sends with nonblocking.
func WithMaxReadLimit ¶
func WithMaxReadLimit(length int64) OptionFunc
WithMaxReadLimit returns a function which sets max size how many data reads from websocket.
Click to show internal directories.
Click to hide internal directories.