Documentation ¶
Index ¶
- Variables
- func HLSWrapper(app *Application) func(ctx *gin.Context)
- func ListWrapper(app *Application) func(ctx *gin.Context)
- func StatusWrapper(app *Application) func(ctx *gin.Context)
- func WebSocketWrapper(app *Application) func(ctx *gin.Context)
- type Application
- type ConfigurationArgs
- type ServerConfiguration
- type ServerInfo
- type StreamArg
- type StreamConfiguration
- type StreamsMap
Constants ¶
This section is empty.
Variables ¶
var ( // ErrStreamNotFound When map of streams doesn't contain requested key ErrStreamNotFound = fmt.Errorf("Stream not found for provided ID") )
Functions ¶
func HLSWrapper ¶ added in v0.2.0
func HLSWrapper(app *Application) func(ctx *gin.Context)
HLSWrapper Returns HLS handler (static files)
func ListWrapper ¶ added in v0.2.0
func ListWrapper(app *Application) func(ctx *gin.Context)
ListWrapper Returns list of streams
func StatusWrapper ¶ added in v0.2.0
func StatusWrapper(app *Application) func(ctx *gin.Context)
StatusWrapper Returns statuses for list of streams
func WebSocketWrapper ¶ added in v0.2.0
func WebSocketWrapper(app *Application) func(ctx *gin.Context)
WebSocketWrapper Returns WS handler
Types ¶
type Application ¶ added in v0.2.0
type Application struct { Server *ServerInfo `json:"server"` Streams StreamsMap `json:"streams"` HlsMsPerSegment int64 `json:"hls_ms_per_segment"` HlsDirectory string `json:"hls_directory"` HlsWindowSize uint `json:"hls_window_size"` HlsCapacity uint `json:"hls_window_capacity"` }
Application Configuration parameters for application
func NewApplication ¶ added in v0.2.0
func NewApplication(cfg *ConfigurationArgs) (*Application, error)
NewApplication Prepare configuration for application
func (*Application) StartHTTPServer ¶ added in v0.2.0
func (app *Application) StartHTTPServer()
StartHTTPServer Initialize http server and run it
func (*Application) StartStreams ¶ added in v0.2.0
func (app *Application) StartStreams()
StartStreams Start video streams
type ConfigurationArgs ¶
type ConfigurationArgs struct { Server ServerConfiguration `json:"server"` Streams []StreamArg `json:"streams"` HlsMsPerSegment int64 `json:"hls_ms_per_segment"` HlsDirectory string `json:"hls_directory"` HlsWindowSize uint `json:"hls_window_size"` HlsCapacity uint `json:"hls_window_capacity"` }
ConfigurationArgs Configuration parameters for application as JSON-file
func NewConfiguration ¶ added in v0.2.0
func NewConfiguration(fname string) (*ConfigurationArgs, error)
NewConfiguration Constructor for ConfigurationArgs
type ServerConfiguration ¶
type ServerConfiguration struct { HTTPAddr string `json:"http_addr"` HTTPPort int `json:"http_port"` }
ServerConfiguration Configuration parameters for server
type ServerInfo ¶ added in v0.2.0
ServerInfo Information about server
type StreamArg ¶
type StreamArg struct { GUID string `json:"guid"` URL string `json:"url"` StreamTypes []string `json:"stream_types"` }
StreamArg Infromation about stream's source
type StreamConfiguration ¶
type StreamConfiguration struct { URL string `json:"url"` Status bool `json:"status"` Codecs []av.CodecData Clients map[uuid.UUID]viewer // contains filtered or unexported fields }
StreamConfiguration Configuration parameters for stream
type StreamsMap ¶ added in v0.2.0
type StreamsMap struct { sync.Mutex Streams map[uuid.UUID]*StreamConfiguration }
StreamsMap Map wrapper for map[uuid.UUID]*StreamConfiguration with mutex for concurrent usage