Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var FatalWebsocketError error = errors.New("fatal websocket error")
Functions ¶
func HandleWebsocket ¶
HandleWebsocket handles the websocket connections.
Types ¶
type HistoryRequestParameters ¶
type HistoryRequestParameters struct {
From time.Time `json:"from,omitempty"`
Until time.Time `json:"until,omitempty"`
MaxDensity interface{} `json:"max_density,omitempty"`
}
HistoryRequestParameters is a model for paramters that can be set with HIST requests.
type Message ¶
type Message struct {
OpCode OpCode `json:"op"`
Target TargetAddress `json:"target"`
Value string `json:"value,omitempty"`
}
Message is the model for a websocket message.
func NewMessage ¶
func NewMessage(opcode OpCode, target TargetAddress, value string) Message
NewMessage returns a Message with chosen OpCode, TargetAddress and value.
type OpCode ¶
type OpCode string
The OpCode type is used to identify the different operations possible.
type TargetAddress ¶
type TargetAddress string
TargetAddress models the target field in websocket messages
func GetEmptyTarget ¶
func GetEmptyTarget() TargetAddress
GetEmptyTarget returns an empty TargetAddress. This is used whenever a message needs to be sent that cannot be assigned to a specific target. I.e. whenever there is no target specified in an erroneous request
Click to show internal directories.
Click to hide internal directories.