This commit is contained in:
seydx
2025-05-20 13:59:46 +02:00
parent e5e55b7a50
commit a2beea1bbd
2 changed files with 13 additions and 6 deletions

View File

@@ -47,7 +47,7 @@ func GetProducer(url string) (core.Producer, error) {
}
if handler, ok := handlers[scheme]; ok {
parsedURL := ParseURL(url)
parsedURL := app.ResolveSecrets(url)
return handler(parsedURL)
}
}
@@ -91,13 +91,10 @@ func GetConsumer(url string) (core.Consumer, func(), error) {
scheme := url[:i]
if handler, ok := consumerHandlers[scheme]; ok {
return handler(url)
parsedURL := app.ResolveSecrets(url)
return handler(parsedURL)
}
}
return nil, nil, errors.New("streams: unsupported scheme: " + url)
}
func ParseURL(url string) string {
return app.ResolveSecrets(url)
}

View File

@@ -1,5 +1,7 @@
package core
import "github.com/AlexxIT/go2rtc/internal/app"
type EventFunc func(msg any)
// Listener base struct for all classes with support feedback
@@ -16,3 +18,11 @@ func (l *Listener) Fire(msg any) {
f(msg)
}
}
func (l *Listener) ParseSource(url string) string {
return app.ResolveSecrets(url)
}
func (l *Listener) SaveSource(path []string, value any) error {
return app.PatchSecret(path, value)
}