Files
hmq/plugins/auth/auth.go
joy.zhou 896769fd9d Add acl (#61)
* update

* update auth file
2019-10-30 14:44:18 +08:00

24 lines
372 B
Go

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