// 返回结果字段名的其索引
// 不存在时索引为-1
555443
func (self *Spider) GetItemFieldIndex(rule *Rule, field string) (index int) {
	for idx, v := range rule.ItemFields {
		if v == field {
			return idx
		}
	}
	return -1
}
622825
func (r *relations) Name(id int) (string, error) {
	relationer, found := r.relationers[id]
	if !found {
		return "", errors.Errorf("unknown relation: %d", id)
	}
	return relationer.ru.Endpoint().Name, nil
}
218338
func (x *XC) NameFromKey(ctx context.Context, id string) string {
	if key := x.pubring.Get(id); key != nil {
		return key.Identity.Name
	}
	if key := x.secring.Get(id); key != nil {
		return key.PublicKey.Identity.Name
	}
	return id
}
205902
func (n *lowercaseSingularNamer) Name(t *types.Type) string {
	return strings.ToLower(t.Name.Name)
}
1207295
func Name(n string) Option {
	return func(o *Options) {
		o.Server.Init(server.Name(n))
	}
}
586663
func (q *QueryStringQuery) QueryName(queryName string) *QueryStringQuery {
	q.queryName = queryName
	return q
}
225533
func (v *Function) GetName() (o string) {
	if v != nil {
		o = v.Name
	}
	return
}
448270
func (v *Argument) GetName() (o string) {
	if v != nil {
		o = v.Name
	}
	return
}
649570
func (self *Collection) GetIndexName() string {
	if self.IndexName != `` {
		return self.IndexName
	}

	return self.Name
}
706375
func (q *RegexpQuery) QueryName(queryName string) *RegexpQuery {
	q.queryName = queryName
	return q
}
806949
func (u *User) GetName() string {
	if u == nil || u.Name == nil {
		return ""
	}
	return *u.Name
}
692649
func (c *CodeResult) GetName() string {
	if c == nil || c.Name == nil {
		return ""
	}
	return *c.Name
}
331481
func (n *NameProvider) GetJSONName(subject interface{}, name string) (string, bool) {
	tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
	return n.GetJSONNameForType(tpe, name)
}
43547
func (q *TermQuery) QueryName(queryName string) *TermQuery {
	q.queryName = queryName
	return q
}
449893
func sanitizeName(name string) string {
	output := strings.ToLower(illegalChars.ReplaceAllString(name, "_"))

	if legalLabel.MatchString(output) {
		return output
	}
	// Prefix name with _ if it begins with a number
	return "_" + output
}
977044
func (r *Request) QName() string {
	if r.Req == nil {
		return "."
	}
	if len(r.Req.Question) == 0 {
		return "."
	}

	return dns.Name(r.Req.Question[0].Name).String()
}
1063200
func (r *Request) Name(s string) *Request {
	r.resourceName = &s
	return r
}