Documentation ¶
Overview ¶
Package api contains the implementation of notypo's streaming-api. This file is structured differently to golang's standard order. I.e. the file is structued by operations. On top, there is the Serve function, that registers all operations. The operations are listed below in the same order as they are registered in the Serve function. The public constants and types relevant to the operation are declared right above the actual function. The private ones right below. The actual api is documented externally using swagger. The comments in this document provide a developers-view
Index ¶
Constants ¶
const ( PathVersion = "/version" PathCreateStream = "/stream" PathOpenStreamConnection = "/stream/{id}" PathCloseStreamConnection = "/stream/{id}" PathEstablishWebsocketToStream = "/stream/websocket/{id}" )
paths
Variables ¶
This section is empty.
Functions ¶
Types ¶
type StreamSourceType ¶
type StreamSourceType string
StreamSourceType is a code for a specific type of streams.StreamSource
const ( // Random StreamSources provide an endless Stream of streams.Characters. The // Characters are randomly picked from a given charset Random StreamSourceType = "Random" // Dictionary StreamSources provide an endless Stream of streams.Characters. // The Characters form words, wich are randomly picked from a dictionary's // subset, wich only consists of a given charset Dictionary StreamSourceType = "Dictionary" )
type StreamSupplierDescription ¶
type StreamSupplierDescription struct { Type StreamSourceType `json:"type"` Charset []rune `json:"charset"` }
StreamSupplierDescription (request) specifies the type and properties of a StreamSupplier
type VersionResponse ¶
type VersionResponse struct { Version string `json:"version"` GitCommit string `json:"git_commit"` BuildTime string `json:"build_time"` }
VersionResponse holds general information about this program