Documentation ¶
Overview ¶
The gordian package provides a simple framework for building multiclient websocket applications.
Index ¶
Constants ¶
View Source
const ( Connect = iota Register Establish Abort Close )
Control types.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Id ClientId // Id is a unique identifier. Ctrl int // Ctrl is the current control type. Conn *websocket.Conn // Conn is the connection info provided by the websocket package. Request *http.Request // Request is the original http request // contains filtered or unexported fields }
Client stores state and control information for a client.
type ClientId ¶
type ClientId interface{}
ClientId is a user-defined client identifier, which can be of any hashable type.
type Gordian ¶
type Gordian struct { Control chan *Client // Control is used to pass client control information within Gordian. InBox chan Message // InBox passes incoming messages from clients to Gordian. OutBox chan Message // OutBox passes outgoing messages from Gordian to clients. // contains filtered or unexported fields }
Gordian processes and distributes messages and manages clients.
Click to show internal directories.
Click to hide internal directories.