mirror of
https://github.com/AlexxIT/go2rtc.git
synced 2025-10-30 03:12:57 +08:00
Initial commit
This commit is contained in:
28
cmd/streams/streams.go
Normal file
28
cmd/streams/streams.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package streams
|
||||
|
||||
import (
|
||||
"github.com/AlexxIT/go2rtc/cmd/app"
|
||||
"github.com/rs/zerolog"
|
||||
)
|
||||
|
||||
var Streams = map[string]*Stream{}
|
||||
|
||||
func Init() {
|
||||
var cfg struct {
|
||||
Mod map[string]interface{} `yaml:"streams"`
|
||||
}
|
||||
|
||||
app.LoadConfig(&cfg)
|
||||
|
||||
log = app.GetLogger("streams")
|
||||
|
||||
for name, item := range cfg.Mod {
|
||||
Streams[name] = newStream(item)
|
||||
}
|
||||
}
|
||||
|
||||
func Get(name string) *Stream {
|
||||
return Streams[name]
|
||||
}
|
||||
|
||||
var log zerolog.Logger
|
||||
Reference in New Issue
Block a user