// NewZone creates an initialized zone with Origin set to origin. func NewZone(origin string) *Zone { if origin == "" { origin = "." } if _, _, ok := IsDomainName(origin); !ok { return nil } z := new(Zone) z.Origin = Fqdn(origin) z.Radix = radix.New() return z }
// NewZone creates an initialized zone with Origin set to origin. func NewZone(origin string) *Zone { if origin == "" { origin = "." } if _, _, ok := IsDomainName(origin); !ok { return nil } z := new(Zone) z.Origin = Fqdn(strings.ToLower(origin)) z.olabels = SplitLabels(z.Origin) z.Radix = radix.New() z.RWMutex = new(sync.RWMutex) return z }
// NewServeMux allocates and returns a new ServeMux. func NewServeMux() *ServeMux { return &ServeMux{r: radix.New(), m: new(sync.RWMutex)} }
// NewServeMux allocates and returns a new ServeMux. func NewServeMux() *ServeMux { return &ServeMux{m: radix.New()} }
func NewCache() *Cache { return &Cache{Radix: radix.New()} }