// withSubdomains appends `.{subdomain}` (for each subdomain spec'd) to records.
// the empty subdomain "" indicates to generate records w/o a subdomain fragment.
962817
func withSubdomains(subdomains []string, gen chain) chain {
	if len(subdomains) == 0 {
		return gen
	}
	return func(records ...string) {
		var (
			recordLen = len(records)
			tmp       = make([]string, recordLen*len(subdomains))
			offset    = 0
		)
		for s := range subdomains {
			if subdomains[s] == domainNone {
				copy(tmp[offset:], records)
			} else {
				for i := range records {
					tmp[offset+i] = records[i] + "." + subdomains[s]
				}
			}
			offset += recordLen
		}
		gen(tmp...)
	}
}
395327
func (v *Oid) AppendSubIds(subs []int) (*Oid, error) {
	buf := bytes.NewBufferString(v.String())
	for _, i := range subs {
		buf.WriteString(".")
		buf.WriteString(strconv.Itoa(i))
	}
	return NewOid(buf.String())
}
1339922
func (o *ListSubjectConsentSessionsParams) WithSubject(subject string) *ListSubjectConsentSessionsParams {
	o.SetSubject(subject)
	return o
}
1185286
func (jolokiaClient *JolokiaClient) ListDomains() ([]string, error) {
	request := NewJolokiaRequest(LIST, "", nil, "")
	resp, requestErr := jolokiaClient.ExecuteRequest(request, "maxDepth=1")
	if requestErr != nil {
		return nil, requestErr
	}
	ret := make([]string, 0, len(resp.Value))
	for key, _ := range resp.Value {
		ret = append(ret, key)
	}
	sort.Strings(ret)
	return ret, nil
}
1003481
func (a *MandrillAPI) SenderDomains() ([]Domain, error) {
	var response []Domain
	var params map[string]interface{} = make(map[string]interface{})
	err := parseMandrillJson(a, senders_domains_endpoint, params, &response)
	return response, err
}
356904
func (o *FindParams) WithTags(tags []int32) *FindParams {
	o.SetTags(tags)
	return o
}
698291
func (s *StorageConnector) SetDomains(v []*string) *StorageConnector {
	s.Domains = v
	return s
}
521957
func splitSubdomainAndPath(fullUnparsedPath string) (subdomain string, path string) {
	s := fullUnparsedPath
	if s == "" || s == "/" {
		return "", "/"
	}

	slashIdx := strings.IndexByte(s, '/')
	if slashIdx == 0 {
		// no subdomain
		return "", cleanPath(s)
	}

	return s[0:slashIdx], cleanPath(s[slashIdx:]) // return subdomain without slash, path with slash
}
75490
func NameIsDNSSubdomain(name string, prefix bool) (bool, string) {
	if prefix {
		name = maskTrailingDash(name)
	}
	if validation.IsDNS1123Subdomain(name) {
		return true, ""
	}
	return false, DNSSubdomainErrorMsg
}
630518
func (Ctx *Context) ListDomain() (glist []Dominfo) {
	err := Ctx.CheckOpen()
	if err != nil {
		return
	}

	var nbDomain C.int
	clist := C.libxl_list_domain(Ctx.ctx, &nbDomain)
	defer C.libxl_dominfo_list_free(clist, nbDomain)

	if int(nbDomain) == 0 {
		return
	}

	gslice := (*[1 << 30]C.libxl_dominfo)(unsafe.Pointer(clist))[:nbDomain:nbDomain]
	for i := range gslice {
		info := gslice[i].toGo()
		glist = append(glist, *info)
	}

	return
}
932459
func (s *DomainService) NewListDomainChildrenParams() *ListDomainChildrenParams {
	p := &ListDomainChildrenParams{}
	p.p = make(map[string]interface{})
	return p
}
1300973
func (c *Client) ListDomains(i *ListDomainsInput) ([]*Domain, error) {
	if i.Service == "" {
		return nil, ErrMissingService
	}

	if i.Version == 0 {
		return nil, ErrMissingVersion
	}

	path := fmt.Sprintf("/service/%s/version/%d/domain", i.Service, i.Version)
	resp, err := c.Get(path, nil)
	if err != nil {
		return nil, err
	}

	var ds []*Domain
	if err := decodeJSON(&ds, resp.Body); err != nil {
		return nil, err
	}
	sort.Stable(domainsByName(ds))
	return ds, nil
}
988371
func WithTags(tags []string) Option {
	return func(o *Options) error {
		o.Tags = tags
		return nil
	}
}
100918
func (r *PCPRegistry) InstanceDomainCount() int {
	r.indomlock.RLock()
	defer r.indomlock.RUnlock()

	return len(r.instanceDomains)
}
997207
func (t *Template) GetAWSSDBDomainWithName(name string) (*resources.AWSSDBDomain, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSSDBDomain:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSSDBDomain not found", name)
}
715372
func Subdomain(url string) string {
	domain, top := stripURLParts(url), Domain(url)
	lt, ld := len(top), len(domain)
	if lt < ld && top != "" {
		return domain[:(ld-lt)-1]
	}
	return ""
}
831210
func (inv *Investigate) RelatedDomains(domain string) ([]RelatedDomain, error) {
	var resp RelatedDomainList
	err := inv.GetParse(fmt.Sprintf(urls["related"], domain), &resp)
	if err != nil {
		return nil, err
	}
	return resp, nil
}