Files
plugin-http-auth/main.go
Anthony.Liu 5ad5190326 add files
2023-03-15 21:31:05 +08:00

30 lines
569 B
Go

package http_auth
import (
. "m7s.live/engine/v4"
"m7s.live/engine/v4/config"
)
type req struct {
Action string `json:"action"`
App string `json:"app"`
Stream string `json:"stream"`
Param string `json:"param"`
ClientID string `json:"client_id"`
}
type HttpAuthConfig struct {
OnPubAddr string
OnSubAddr string
}
func (p *HttpAuthConfig) OnEvent(event any) {
switch event.(type) {
case FirstConfig: //插件初始化逻辑
p.changeAuthHook()
case config.Config: //插件热更新逻辑
}
}
var plugin = InstallPlugin(new(HttpAuthConfig))