diff --git a/cmd/streams/stream.go b/cmd/streams/stream.go index e0f52d9d..f33ea8b0 100644 --- a/cmd/streams/stream.go +++ b/cmd/streams/stream.go @@ -15,7 +15,7 @@ type Stream struct { consumers []*Consumer } -func newStream(source interface{}) *Stream { +func NewStream(source interface{}) *Stream { s := new(Stream) switch source := source.(type) { @@ -28,7 +28,7 @@ func newStream(source interface{}) *Stream { s.producers = append(s.producers, prod) } case map[string]interface{}: - return newStream(source["url"]) + return NewStream(source["url"]) default: panic("wrong source type") } diff --git a/cmd/streams/stream_test.go b/cmd/streams/stream_test.go index 241bcb9f..959e224f 100644 --- a/cmd/streams/stream_test.go +++ b/cmd/streams/stream_test.go @@ -115,7 +115,7 @@ func TestRouting(t *testing.T) { assert.Len(t, cons.Medias, 3) // setup stream with one producer - stream := newStream("fake:") + stream := NewStream("fake:") // main check: err := stream.AddConsumer(cons) diff --git a/cmd/streams/streams.go b/cmd/streams/streams.go index 63c08e36..a9a1e558 100644 --- a/cmd/streams/streams.go +++ b/cmd/streams/streams.go @@ -17,7 +17,7 @@ func Init() { log = app.GetLogger("streams") for name, item := range cfg.Mod { - Streams[name] = newStream(item) + Streams[name] = NewStream(item) } }