mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2025-12-14 22:18:17 +08:00
add web output backend
This commit is contained in:
@@ -3,6 +3,7 @@ package controller
|
||||
type Plugin interface {
|
||||
Name() string
|
||||
Enable() error
|
||||
Disable() error
|
||||
}
|
||||
|
||||
func LoadPlugin(plugin Plugin) {
|
||||
@@ -17,3 +18,13 @@ func LoadPlugins(plugins ...Plugin) {
|
||||
LoadPlugin(plugin)
|
||||
}
|
||||
}
|
||||
|
||||
func ClosePlugins(plugins ...Plugin) {
|
||||
for _, plugin := range plugins {
|
||||
err := plugin.Disable()
|
||||
if err != nil {
|
||||
l().Warnf("Failed to close plugin: %s, %s", plugin.Name(), err)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user