mirror of
https://github.com/datarhei/core.git
synced 2025-09-26 20:11:29 +08:00
Add GoSRT & improvements (repo-merge)
Commits (Ingo Oppermann): - Add experimental SRT connection stats and logs - Hide /config/reload endpoint in reade-only mode - Add SRT server - Create v16 in go.mod - Fix data races, tests, lint, and update dependencies - Add trailing slash for routed directories (datarhei/restreamer#340) - Allow relative URLs in content in static routes Co-Authored-By: Ingo Oppermann <57445+ioppermann@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package app
|
||||
|
||||
import "github.com/datarhei/core/process"
|
||||
import "github.com/datarhei/core/v16/process"
|
||||
|
||||
type ConfigIOCleanup struct {
|
||||
Pattern string `json:"pattern"`
|
||||
|
@@ -6,8 +6,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/datarhei/core/io/fs"
|
||||
"github.com/datarhei/core/log"
|
||||
"github.com/datarhei/core/v16/io/fs"
|
||||
"github.com/datarhei/core/v16/log"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
@@ -117,7 +117,7 @@ func (fs *filesystem) UnsetCleanup(id string) {
|
||||
fs.cleanupLock.Lock()
|
||||
defer fs.cleanupLock.Unlock()
|
||||
|
||||
patterns, _ := fs.cleanupPatterns[id]
|
||||
patterns := fs.cleanupPatterns[id]
|
||||
|
||||
delete(fs.cleanupPatterns, id)
|
||||
|
||||
|
@@ -5,7 +5,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/datarhei/core/io/fs"
|
||||
"github.com/datarhei/core/v16/io/fs"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
@@ -10,17 +10,17 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/datarhei/core/ffmpeg"
|
||||
"github.com/datarhei/core/ffmpeg/parse"
|
||||
"github.com/datarhei/core/ffmpeg/skills"
|
||||
"github.com/datarhei/core/io/fs"
|
||||
"github.com/datarhei/core/log"
|
||||
"github.com/datarhei/core/net"
|
||||
"github.com/datarhei/core/net/url"
|
||||
"github.com/datarhei/core/process"
|
||||
"github.com/datarhei/core/restream/app"
|
||||
rfs "github.com/datarhei/core/restream/fs"
|
||||
"github.com/datarhei/core/restream/store"
|
||||
"github.com/datarhei/core/v16/ffmpeg"
|
||||
"github.com/datarhei/core/v16/ffmpeg/parse"
|
||||
"github.com/datarhei/core/v16/ffmpeg/skills"
|
||||
"github.com/datarhei/core/v16/io/fs"
|
||||
"github.com/datarhei/core/v16/log"
|
||||
"github.com/datarhei/core/v16/net"
|
||||
"github.com/datarhei/core/v16/net/url"
|
||||
"github.com/datarhei/core/v16/process"
|
||||
"github.com/datarhei/core/v16/restream/app"
|
||||
rfs "github.com/datarhei/core/v16/restream/fs"
|
||||
"github.com/datarhei/core/v16/restream/store"
|
||||
)
|
||||
|
||||
// The Restreamer interface
|
||||
@@ -118,20 +118,23 @@ func New(config Config) (Restreamer, error) {
|
||||
r.store = store.NewDummyStore(store.DummyConfig{})
|
||||
}
|
||||
|
||||
r.fs.diskfs = rfs.New(rfs.Config{
|
||||
FS: config.DiskFS,
|
||||
Logger: r.logger.WithComponent("DiskFS"),
|
||||
})
|
||||
if r.fs.diskfs == nil {
|
||||
if config.DiskFS != nil {
|
||||
r.fs.diskfs = rfs.New(rfs.Config{
|
||||
FS: config.DiskFS,
|
||||
Logger: r.logger.WithComponent("DiskFS"),
|
||||
})
|
||||
} else {
|
||||
r.fs.diskfs = rfs.New(rfs.Config{
|
||||
FS: fs.NewDummyFilesystem(),
|
||||
})
|
||||
}
|
||||
r.fs.memfs = rfs.New(rfs.Config{
|
||||
FS: config.MemFS,
|
||||
Logger: r.logger.WithComponent("MemFS"),
|
||||
})
|
||||
if r.fs.memfs == nil {
|
||||
|
||||
if config.MemFS != nil {
|
||||
r.fs.memfs = rfs.New(rfs.Config{
|
||||
FS: config.MemFS,
|
||||
Logger: r.logger.WithComponent("MemFS"),
|
||||
})
|
||||
} else {
|
||||
r.fs.memfs = rfs.New(rfs.Config{
|
||||
FS: fs.NewDummyFilesystem(),
|
||||
})
|
||||
@@ -1250,7 +1253,7 @@ func (r *restream) GetPlayout(id, inputid string) (string, error) {
|
||||
}
|
||||
|
||||
if !task.valid {
|
||||
return "", fmt.Errorf("Invalid process definition")
|
||||
return "", fmt.Errorf("invalid process definition")
|
||||
}
|
||||
|
||||
port, ok := task.playout[inputid]
|
||||
|
@@ -4,9 +4,9 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/datarhei/core/ffmpeg"
|
||||
"github.com/datarhei/core/net"
|
||||
"github.com/datarhei/core/restream/app"
|
||||
"github.com/datarhei/core/v16/ffmpeg"
|
||||
"github.com/datarhei/core/v16/net"
|
||||
"github.com/datarhei/core/v16/restream/app"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"github.com/datarhei/core/restream/app"
|
||||
"github.com/datarhei/core/v16/restream/app"
|
||||
)
|
||||
|
||||
type StoreData struct {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"github.com/datarhei/core/log"
|
||||
"github.com/datarhei/core/v16/log"
|
||||
)
|
||||
|
||||
type DummyConfig struct {
|
||||
|
@@ -7,9 +7,9 @@ import (
|
||||
"os"
|
||||
"sync"
|
||||
|
||||
"github.com/datarhei/core/encoding/json"
|
||||
"github.com/datarhei/core/io/file"
|
||||
"github.com/datarhei/core/log"
|
||||
"github.com/datarhei/core/v16/encoding/json"
|
||||
"github.com/datarhei/core/v16/io/file"
|
||||
"github.com/datarhei/core/v16/log"
|
||||
)
|
||||
|
||||
type JSONConfig struct {
|
||||
|
@@ -3,7 +3,7 @@ package store
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/datarhei/core/log"
|
||||
"github.com/datarhei/core/v16/log"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
Reference in New Issue
Block a user