add auther api

This commit is contained in:
ginuerzh
2022-02-12 14:12:09 +08:00
parent 345338d410
commit fdd67a6086
10 changed files with 293 additions and 13 deletions

View File

@ -19,6 +19,9 @@ type bypassRegistry struct {
}
func (r *bypassRegistry) Register(name string, bypass bypass.Bypass) error {
if name == "" || bypass == nil {
return nil
}
if _, loaded := r.m.LoadOrStore(name, bypass); loaded {
return ErrDup
}