Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SolutionHandler ¶
func SolutionHandler(client *compute.Client, metadataCtor apiModel.MetadataStorageCtor, dataCtor apiModel.DataStorageCtor, solutionCtor apiModel.SolutionStorageCtor, modelCtor apiModel.ExportedModelStorageCtor) func(http.ResponseWriter, *http.Request)
SolutionHandler represents a solution websocket handler.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection represents a single clients tile dispatcher.
func NewConnection ¶
func NewConnection(w http.ResponseWriter, r *http.Request, handler requestHandler) (*Connection, error)
NewConnection returns a pointer to a new tile dispatcher object.
func (*Connection) Close ¶
func (c *Connection) Close()
Close closes the dispatchers websocket connection.
func (*Connection) ListenAndRespond ¶
func (c *Connection) ListenAndRespond() error
ListenAndRespond waits on both tile request and responses and handles each until the websocket connection dies.
func (*Connection) SendResponse ¶
func (c *Connection) SendResponse(res interface{}) error
SendResponse will send a json response in a thread safe manner.
type Message ¶
type Message struct { Type string `json:"type"` ID string `json:"id"` Timestamp time.Time `json:"-"` Body json.RawMessage `json:"body"` }
Message represents a websocket message.
func NewMessage ¶
NewMessage parses and instantiates a new message struct.
Click to show internal directories.
Click to hide internal directories.