mirror of
https://github.com/AynaLivePlayer/miaosic.git
synced 2025-12-06 13:02:48 +08:00
init
This commit is contained in:
26
registry.go
Normal file
26
registry.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package miaosic
|
||||
|
||||
import (
|
||||
"github.com/aynakeya/deepcolor"
|
||||
"github.com/aynakeya/deepcolor/dphttp"
|
||||
)
|
||||
|
||||
var Requester dphttp.IRequester = deepcolor.NewRestyRequester()
|
||||
|
||||
var _providers map[string]MediaProvider = make(map[string]MediaProvider)
|
||||
|
||||
func RegisterProvider(provider MediaProvider) {
|
||||
if _, ok := _providers[provider.GetName()]; ok {
|
||||
panic("provider " + provider.GetName() + " already exists")
|
||||
return
|
||||
}
|
||||
_providers[provider.GetName()] = provider
|
||||
}
|
||||
|
||||
func ListAvailableProviders() []string {
|
||||
var names []string
|
||||
for name := range _providers {
|
||||
names = append(names, name)
|
||||
}
|
||||
return names
|
||||
}
|
||||
Reference in New Issue
Block a user