// Field returns the value for the given fieldpath as a string, if defined.
// If the value is not defined, the second value will be false.
160141
func (m *TaskCreate) Field(fieldpath []string) (string, bool) {
	if len(fieldpath) == 0 {
		return "", false
	}

	switch fieldpath[0] {
	// unhandled: rootfs
	// unhandled: pid
	case "container_id":
		return string(m.ContainerID), len(m.ContainerID) > 0
	case "bundle":
		return string(m.Bundle), len(m.Bundle) > 0
	case "io":
		// NOTE(stevvooe): This is probably not correct in many cases.
		// We assume that the target message also implements the Field
		// method, which isn't likely true in a lot of cases.
		//
		// If you have a broken build and have found this comment,
		// you may be closer to a solution.
		if m.IO == nil {
			return "", false
		}

		return m.IO.Field(fieldpath[1:])
	case "checkpoint":
		return string(m.Checkpoint), len(m.Checkpoint) > 0
	}
	return "", false
}
943853
func (e *Envelope) Field(fieldpath []string) (string, bool) {
	if len(fieldpath) == 0 {
		return "", false
	}

	switch fieldpath[0] {
	// unhandled: timestamp
	case "namespace":
		return e.Namespace, len(e.Namespace) > 0
	case "topic":
		return e.Topic, len(e.Topic) > 0
	case "event":
		decoded, err := typeurl.UnmarshalAny(e.Event)
		if err != nil {
			return "", false
		}

		adaptor, ok := decoded.(interface {
			Field([]string) (string, bool)
		})
		if !ok {
			return "", false
		}
		return adaptor.Field(fieldpath[1:])
	}
	return "", false
}
36096
func (m *Envelope) Field(fieldpath []string) (string, bool) {
	if len(fieldpath) == 0 {
		return "", false
	}

	switch fieldpath[0] {
	// unhandled: timestamp
	case "namespace":
		return string(m.Namespace), len(m.Namespace) > 0
	case "topic":
		return string(m.Topic), len(m.Topic) > 0
	case "event":
		decoded, err := github_com_containerd_typeurl.UnmarshalAny(m.Event)
		if err != nil {
			return "", false
		}

		adaptor, ok := decoded.(interface{ Field([]string) (string, bool) })
		if !ok {
			return "", false
		}
		return adaptor.Field(fieldpath[1:])
	}
	return "", false
}
806694
func (e *FieldEntry) String() string {
	value := e.Value
	if s, ok := value.(fmt.Stringer); ok {
		value = s.String()
	}

	switch v := value.(type) {
	case string:
		return fmt.Sprintf("%q:%q", e.Key, v)

	case error:
		return fmt.Sprintf("%q:%q", e.Key, v.Error())

	default:
		return fmt.Sprintf("%q:%#v", e.Key, v)
	}
}
24473
func (s *IndicesGetFieldMappingService) Field(fields ...string) *IndicesGetFieldMappingService {
	s.field = append(s.field, fields...)
	return s
}
943668
func (m *ImageDelete) Field(fieldpath []string) (string, bool) {
	if len(fieldpath) == 0 {
		return "", false
	}

	switch fieldpath[0] {
	case "name":
		return string(m.Name), len(m.Name) > 0
	}
	return "", false
}
1115364
func (document Document) Field(field string) interface{} {
	r, _ := document.Fields[field]
	return r
}
1230236
func (f *Field) Value() interface{} {
	pieces := strings.Split(f.Name, ".")
	answer, ok := f.viewArgs[pieces[0]]
	if !ok {
		return ""
	}

	val := reflect.ValueOf(answer)
	for i := 1; i < len(pieces); i++ {
		if val.Kind() == reflect.Ptr {
			val = val.Elem()
		}
		val = val.FieldByName(pieces[i])
		if !val.IsValid() {
			return ""
		}
	}

	return val.Interface()
}
1078262
func (f *Field) String() string {
	str := f.Expr.String()

	if f.Alias == "" {
		return str
	}
	return fmt.Sprintf("%s AS %s", str, QuoteIdent(f.Alias))
}
1164547
func (p FieldPath) String() string {
	var components []string
	for _, c := range p {
		components = append(components, c.Name)
	}
	return strings.Join(components, ".")
}
73571
func (f *Field) Field(name string) *Field {
	field, ok := f.FieldOk(name)
	if !ok {
		panic("field not found")
	}

	return field
}
247050
func (c *Config) getField(name string, idx int, opts *options) (value, Error) {
	p := parsePathIdx(name, opts.pathSep, idx)
	v, err := p.GetValue(c, opts)
	if err != nil {
		return v, err
	}

	if v == nil {
		return nil, raiseMissing(c, p.String())
	}
	return v, nil
}
130553
func (s *Scrubber) fields(rv reflect.Value, path Path, callbacks map[string]Path) {
	for i := 0; i < rv.NumField(); i++ {
		sf := rv.Type().Field(i)
		if sf.PkgPath != "" && !sf.Anonymous { // unexported.
			continue
		}

		// dnode uses JSON package tags for field naming so we need to
		// discard their comma-separated options.
		tag := sf.Tag.Get("json")
		if idx := strings.Index(tag, ","); idx != -1 {
			tag = tag[:idx]
		}
		if tag == "-" {
			continue
		}
		// do not collect callbacks for "-" tagged fields.
		if skip := sf.Tag.Get("dnode"); skip == "-" {
			continue
		}

		var name = tag
		if name == "" {
			name = sf.Name
		}

		if sf.Anonymous {
			s.collect(rv.Field(i), path, callbacks)
		} else {
			s.collect(rv.Field(i), append(path, name), callbacks)
		}
	}
}
1280607
func (q *BooleanFieldQuery) Field(field string) *BooleanFieldQuery {
	q.options["field"] = field
	return q
}
709588
func (a *CompositeAggregationTermsValuesSource) Field(field string) *CompositeAggregationTermsValuesSource {
	a.field = field
	return a
}
536665
func (f fieldVal) String() string {
	t := new(fieldVal).Set(&f).Normalize()
	return hex.EncodeToString(t.Bytes()[:])
}
916628
func (f *fieldHolder) AddField(key string, val interface{}) {
	f.lock.Lock()
	defer f.lock.Unlock()
	f.data[key] = val
}