mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2025-06-29 21:31:07 +02:00
Create config package and properly use Viper
This commit is contained in:
28
main_test.go
28
main_test.go
@ -1,29 +1 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
"gitlab.crans.org/nounous/ghostream/auth"
|
||||
"gitlab.crans.org/nounous/ghostream/internal/monitoring"
|
||||
"gitlab.crans.org/nounous/ghostream/stream/forwarding"
|
||||
"gitlab.crans.org/nounous/ghostream/stream/srt"
|
||||
"gitlab.crans.org/nounous/ghostream/stream/webrtc"
|
||||
"gitlab.crans.org/nounous/ghostream/web"
|
||||
)
|
||||
|
||||
// TestLoadConfiguration tests the configuration file loading and the init of some parameters
|
||||
func TestLoadConfiguration(t *testing.T) {
|
||||
loadConfiguration()
|
||||
cfg := struct {
|
||||
Auth auth.Options
|
||||
Forwarding forwarding.Options
|
||||
Monitoring monitoring.Options
|
||||
Srt srt.Options
|
||||
Web web.Options
|
||||
WebRTC webrtc.Options
|
||||
}{}
|
||||
if err := viper.Unmarshal(&cfg); err != nil {
|
||||
t.Fatal("Failed to load settings", err)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user