mirror of
https://github.com/go-gost/gost.git
synced 2026-10-10 04:55:46 +00:00
add auther api
This commit is contained in:
@@ -18,8 +18,11 @@ type autherRegistry struct {
|
||||
m sync.Map
|
||||
}
|
||||
|
||||
func (r *autherRegistry) Register(name string, auth auth.Authenticator) error {
|
||||
if _, loaded := r.m.LoadOrStore(name, auth); loaded {
|
||||
func (r *autherRegistry) Register(name string, auther auth.Authenticator) error {
|
||||
if name == "" || auther == nil {
|
||||
return nil
|
||||
}
|
||||
if _, loaded := r.m.LoadOrStore(name, auther); loaded {
|
||||
return ErrDup
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user