// NewZone returns a new zone.
346290
func NewZone(name, file string) *Zone {
	z := &Zone{
		origin:         dns.Fqdn(name),
		origLen:        dns.CountLabel(dns.Fqdn(name)),
		file:           path.Clean(file),
		Tree:           &tree.Tree{},
		Expired:        new(bool),
		ReloadShutdown: make(chan bool),
	}
	*z.Expired = false

	return z
}
688516
func (az *Cloud) makeZone(zoneID int) string {
	return fmt.Sprintf("%s-%d", strings.ToLower(az.Location), zoneID)
}
880525
func NewLocker(lockerConfig config.Locker) (*lock, error) {
	c, _, err := zk.Connect(lockerConfig.Address, time.Millisecond*100)
	if err != nil {
		return nil, err
	}
	return &lock{c}, nil
}
1351770
func (z *Zone) Copy() *Zone {
	z1 := NewZone(z.origin, z.file)
	z1.TransferTo = z.TransferTo
	z1.TransferFrom = z.TransferFrom
	z1.Expired = z.Expired

	z1.Apex = z.Apex
	return z1
}
380099
func (v *VPCRouter) Zone() string {
	if v.Switch != nil {
		return v.Switch.GetZoneName()
	}

	if len(v.Interfaces) > 0 && v.Interfaces[0].Switch != nil {
		return v.Interfaces[0].Switch.GetZoneName()
	}

	return ""
}
179561
func New(zones []string) *Kubernetes {
	k := new(Kubernetes)
	k.Zones = zones
	k.Namespaces = make(map[string]struct{})
	k.interfaceAddrsFunc = func() net.IP { return net.ParseIP("127.0.0.1") }
	k.podMode = podModeDisabled
	k.ttl = defaultTTL

	return k
}
906209
func (s *ProfileData) SetTimezone(v string) *ProfileData {
	s.Timezone = &v
	return s
}
581947
func (s *DBInstance) SetTimezone(v string) *DBInstance {
	s.Timezone = &v
	return s
}
876549
func (s *UpdateProfileInput) SetTimezone(v string) *UpdateProfileInput {
	s.Timezone = &v
	return s
}
607998
func Zone(loc *time.Location) (string, int64) {
	_, offset := time.Now().In(loc).Zone()
	name := loc.String()
	// when we found name is "System", we have no chice but push down
	// "System" to tikv side.
	if name == "Local" {
		name = "System"
	}

	return name, int64(offset)
}
437065
func (zones *Zones) Create(ctx context.Context, domain string) (zone *Zone, err error) {
	buffer := new(bytes.Buffer)
	err = json.NewEncoder(buffer).Encode(struct {
		Name string `json:"name"`
	}{
		Name: domain,
	})
	if err != nil {
		return
	}
	response, err := httpDo(ctx, zones.Options, "POST", apiURL("/zones"), buffer)
	if err != nil {
		return
	}
	defer response.Body.Close()
	result, err := readResponse(response.Body)
	if err != nil {
		return
	}
	zone = new(Zone)
	err = json.Unmarshal(result.Result, &zone)
	return
}
973136
func (c *ConvenientClient) PublishZone(zone string) error {
	url := fmt.Sprintf("Zone/%s", zone)
	data := &PublishZoneBlock{
		Publish: true,
	}

	if err := c.Do("PUT", url, data, nil); err != nil {
		return fmt.Errorf("Failed to publish zone: %s", err)
	}

	return nil
}
713373
func (z *zones) Add(addZone dnsprovider.Zone) (dnsprovider.Zone, error) {
	zoneToAdd, ok := addZone.(*zone)
	if !ok {
		return nil, fmt.Errorf("unexpected zone type: %T", addZone)
	}

	zoneInfo, err := z.dnsView.AddZone(zoneToAdd.zoneInfo)
	if err != nil {
		return nil, err
	}
	return &zone{dnsView: z.dnsView, zoneInfo: *zoneInfo}, nil
}
951183
func (client *Client) AddZone(args *AddZoneArgs) (response *AddZoneResponse, err error) {
	response = &AddZoneResponse{}

	err = client.Invoke("AddZone", args, &response)

	return response, err
}
792639
func (s *WeeklyStartTime) SetTimeZone(v string) *WeeklyStartTime {
	s.TimeZone = &v
	return s
}
1308438
func (c *ConvenientClient) CreateZone(zone, rname, serialStyle, ttl string) error {
	url := fmt.Sprintf("Zone/%s/", zone)
	data := &CreateZoneBlock{
		RName:       rname,
		SerialStyle: serialStyle,
		TTL:         ttl,
	}

	if err := c.Do("POST", url, data, nil); err != nil {
		return fmt.Errorf("Failed to create zone: %s", err)
	}

	return nil
}
492574
func (vs *VSphere) Zones() (cloudprovider.Zones, bool) {
	if vs.isZoneEnabled() {
		return vs, true
	}
	klog.V(1).Info("The vSphere cloud provider does not support zones")
	return nil, false
}