Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection interface { ID() string Node() string AuthIdentity() string Start(ctx context.Context, readMsgHandler func(msgType int, bytes []byte)) error Write(msg []byte) error Close() error }
Connection for Websocket Server 2.0
func New ¶
func New(args ConstructorArgs, conn *websocket.Conn, opts ...Option) Connection
New will return a new Websocket connection that would bridge to a message queue. For now, underlying connection is stemmed from gorilla.websocket
type ConstructorArgs ¶
ConstructorArgs for WebsocketConnection
type Factory ¶
type Factory interface { // NewConnection for WS Server 2.0. NewConnection(args ConstructorArgs, conn *websocket.Conn, opts ...Option) Connection }
Factory for Connection.
func NewFactory ¶
NewFactory for WSConnection. Saves and passes appropriate option.
type Option ¶
type Option func(*configuration)
Option is the function signature that applies configurable option for UILoadWebsocket.
func MaxInactiveDuration ¶
MaxInactiveDuration means the max time a connection can be 'quiet' before server will deem it as inactive and dead. Idea is that pongs and client-based pings would suffice. Default 1m.
func PingInterval ¶
PingInterval sets frequency to write ping messages. Default 30s.
func ReadDeadline ¶
ReadDeadline for how long it should wait until reading a message. Default infinite.
func WriteDeadline ¶
WriteDeadline for how long it should try before giving up writing a message. Default 3s.