// BindDomain binds domain to context.
515742
func BindDomain(ctx sessionctx.Context, domain *Domain) {
	ctx.SetValue(domainKey, domain)
}
290204
func Domain(s string) string {
	d, err := publicsuffix.EffectiveTLDPlusOne(s)
	if err != nil {
		panic(errors.Wrap(err, "effective domain"))
	}

	return d
}
366046
func (org *Organization) Domain(domain string) (*Domain, error) {
	var d domainsResponse
	err := org.PPE.get(fmt.Sprintf("/domains/%s/%s", org.PrimaryDomain, domain), &d)
	if err != nil {
		return &Domain{}, err
	}
	return domainFromDomainResponse(org, d.Domains[0]), nil
}
1025458
func (s *ResendValidationEmailInput) SetDomain(v string) *ResendValidationEmailInput {
	s.Domain = &v
	return s
}
159222
func (s *VerifyDomainDkimInput) SetDomain(v string) *VerifyDomainDkimInput {
	s.Domain = &v
	return s
}
290319
func (a *MandrillAPI) InboundDomainDelete(domain string) (InboundDomain, error) {
	return getInboundDomain(a, domain, delete_domain_endpoint)
}
466536
func (s *ElasticIp) SetDomain(v string) *ElasticIp {
	s.Domain = &v
	return s
}
1370364
func (a *SetCookieArgs) SetDomain(domain string) *SetCookieArgs {
	a.Domain = &domain
	return a
}
677744
func (l *Locale) SetDomain(dom string) {
	l.Lock()
	l.defaultDomain = dom
	l.Unlock()
}
324332
func (r Dns_Domain_Registration) LookupDomain(domainName *string) (resp []datatypes.Container_Dns_Domain_Registration_Lookup, err error) {
	params := []interface{}{
		domainName,
	}
	err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "lookupDomain", params, &r.Options, &resp)
	return
}
799641
func (s *DeleteUserPoolDomainInput) SetDomain(v string) *DeleteUserPoolDomainInput {
	s.Domain = &v
	return s
}
509053
func (s *PollForActivityTaskInput) SetDomain(v string) *PollForActivityTaskInput {
	s.Domain = &v
	return s
}
314291
func NewDomain() *Domain {

	return &Domain{
		PATEnabled:            "DISABLED",
		DHCPBehavior:          "CONSUME",
		FIPIgnoreDefaultRoute: "DISABLED",
		FIPUnderlay:           false,
		DPI:                   "DISABLED",
		VXLANECMPEnabled:      false,
		MaintenanceMode:       "DISABLED",
		AggregateFlowsEnabled: false,
		FlowCollectionEnabled: "INHERITED",
		Encryption:            "DISABLED",
		UnderlayEnabled:       "DISABLED",
		TunnelType:            "DC_DEFAULT",
	}
}
886665
func (s *Server) allowDomain(ctx context.Context, host string) (err error) {
	host = strings.ToLower(strings.TrimSpace(host))
	if err = s.config.checkDomainLists(host); err != nil {
		return err
	}

	// DoS protection: look up kbp TXT record before attempting ACME cert
	// issuance, and only allow those that have DNS records configured. This is
	// in case someone keeps sending us TLS handshakes with random SNIs,
	// causing us to be rate-limited by the ACME server.
	//
	// TODO: cache the parsed root somewhere so we don't end up doing it twice
	// for each connection.
	if _, err = s.rootLoader.LoadRoot(host); err != nil {
		return err
	}

	return nil
}
685957
func (s *PollForDecisionTaskInput) SetDomain(v string) *PollForDecisionTaskInput {
	s.Domain = &v
	return s
}
354077
func (ctx *context) Subdomain() (subdomain string) {
	host := ctx.Host()
	if index := strings.IndexByte(host, '.'); index > 0 {
		subdomain = host[0:index]
	}

	// listening on mydomain.com:80
	// subdomain = mydomain, but it's wrong, it should return ""
	vhost := ctx.Application().ConfigurationReadOnly().GetVHost()
	if strings.Contains(vhost, subdomain) { // then it's not subdomain
		return ""
	}

	return
}
629841
func (s *UpdateUserPoolDomainInput) SetDomain(v string) *UpdateUserPoolDomainInput {
	s.Domain = &v
	return s
}