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

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