mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2026-03-15 22:13:17 +08:00
config panel, kuwo source, playlist operation, bug fix @6, panic handling
This commit is contained in:
19
controller/plugin.go
Normal file
19
controller/plugin.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package controller
|
||||
|
||||
type Plugin interface {
|
||||
Name() string
|
||||
Enable() error
|
||||
}
|
||||
|
||||
func LoadPlugin(plugin Plugin) {
|
||||
l().Info("Loading plugin: " + plugin.Name())
|
||||
if err := plugin.Enable(); err != nil {
|
||||
l().Warnf("Failed to load plugin: %s, %s", plugin.Name(), err)
|
||||
}
|
||||
}
|
||||
|
||||
func LoadPlugins(plugins ...Plugin) {
|
||||
for _, plugin := range plugins {
|
||||
LoadPlugin(plugin)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user