Files
hmq/plugins/auth/auth.go
2019-08-19 10:33:19 +08:00

24 lines
358 B
Go

package auth
import (
"github.com/fhmq/hmq/plugins/auth/authhttp"
)
const (
AuthHTTP = "authhttp"
)
type Auth interface {
CheckACL(action, username, topic string) bool
CheckConnect(clientID, username, password string) bool
}
func NewAuth(name string) Auth {
switch name {
case AuthHTTP:
return authhttp.Init()
default:
return &mockAuth{}
}
}