mirror of
https://github.com/fhmq/hmq.git
synced 2026-04-24 10:38:34 +00:00
@@ -1,11 +1,13 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
authfile "github.com/fhmq/hmq/plugins/auth/authfile"
|
||||
"github.com/fhmq/hmq/plugins/auth/authhttp"
|
||||
)
|
||||
|
||||
const (
|
||||
AuthHTTP = "authhttp"
|
||||
AuthFile = "authfile"
|
||||
)
|
||||
|
||||
type Auth interface {
|
||||
@@ -17,6 +19,8 @@ func NewAuth(name string) Auth {
|
||||
switch name {
|
||||
case AuthHTTP:
|
||||
return authhttp.Init()
|
||||
case AuthFile:
|
||||
return authfile.Init()
|
||||
default:
|
||||
return &mockAuth{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user