Просмотр исходного кода

Rename zones.Zones to zones.ZoneList

gorename -d -from 'github.com/abh/geodns/zones'.Zones -to ZoneList  | patch -p8
Ask Bjørn Hansen 8 лет назад
Родитель
Сommit
ee7a30ca0b
3 измененных файлов с 7 добавлено и 7 удалено
  1. 2 2
      http.go
  2. 3 3
      zones/muxmanager.go
  3. 2 2
      zones/zones.go

+ 2 - 2
http.go

@@ -19,7 +19,7 @@ import (
 
 type httpServer struct {
 	mux        *http.ServeMux
-	zones      zones.Zones
+	zones      zones.ZoneList
 	serverInfo monitor.ServerInfo
 }
 
@@ -82,7 +82,7 @@ func topParam(req *http.Request, def int) int {
 	return topOption
 }
 
-func NewHTTPServer(zones zones.Zones) *httpServer {
+func NewHTTPServer(zones zones.ZoneList) *httpServer {
 	hs := &httpServer{
 		// todo: zones.MuxManager instead of zones?
 		zones: zones,

+ 3 - 3
zones/muxmanager.go

@@ -22,7 +22,7 @@ type RegistrationAPI interface {
 
 type MuxManager struct {
 	reg      RegistrationAPI
-	zonelist Zones
+	zonelist ZoneList
 	path     string
 	lastRead map[string]*zoneReadRecord
 }
@@ -37,7 +37,7 @@ func NewMuxManager(path string, reg RegistrationAPI) (*MuxManager, error) {
 	mm := &MuxManager{
 		reg:      reg,
 		path:     path,
-		zonelist: make(Zones),
+		zonelist: make(ZoneList),
 		lastRead: map[string]*zoneReadRecord{},
 	}
 
@@ -61,7 +61,7 @@ func (mm *MuxManager) Run() {
 
 // GetZones returns the list of currently active zones in the mux manager.
 // (todo: rename to Zones() when the Zones struct has been renamed to ZoneList)
-func (mm *MuxManager) Zones() Zones {
+func (mm *MuxManager) Zones() ZoneList {
 	return mm.zonelist
 }
 

+ 2 - 2
zones/zones.go

@@ -18,8 +18,8 @@ import (
 	"github.com/miekg/dns"
 )
 
-// Zones maps domain names to zone data
-type Zones map[string]*Zone
+// ZoneList maps domain names to zone data
+type ZoneList map[string]*Zone
 
 func ReadZoneFile(zoneName, fileName string) (zone *Zone, zerr error) {
 	defer func() {