Code refactoring for streams HandleFunc

This commit is contained in:
Alex X
2024-06-14 12:48:29 +03:00
parent 1ac9d54dab
commit ecfe802065
15 changed files with 53 additions and 93 deletions
+3 -5
View File
@@ -10,15 +10,13 @@ import (
)
func Init() {
streams.HandleFunc("gopro", handleGoPro)
streams.HandleFunc("gopro", func(source string) (core.Producer, error) {
return gopro.Dial(source)
})
api.HandleFunc("api/gopro", apiGoPro)
}
func handleGoPro(rawURL string) (core.Producer, error) {
return gopro.Dial(rawURL)
}
func apiGoPro(w http.ResponseWriter, r *http.Request) {
var items []*api.Source