// Meta sets the meta data to be included in the aggregation response.
973455
func (a *DateRangeAggregation) Meta(metaData map[string]interface{}) *DateRangeAggregation {
	a.meta = metaData
	return a
}
1270683
func (a *GeoDistanceAggregation) Meta(metaData map[string]interface{}) *GeoDistanceAggregation {
	a.meta = metaData
	return a
}
203892
func (ws *ArchiveWorkspace) Metadata() (*Metadata, error) {
	metaFile, err := os.Open(ws.MetadataFile)
	if err != nil {
		return nil, errors.Trace(err)
	}
	defer metaFile.Close()

	meta, err := NewMetadataJSONReader(metaFile)
	return meta, errors.Trace(err)
}
609382
func (a *DateHistogramAggregation) Meta(metaData map[string]interface{}) *DateHistogramAggregation {
	a.meta = metaData
	return a
}
1260332
func withMetadata(c context.Context, cli *metadata.Client) context.Context {
	return context.WithValue(c, &metaKey, cli)
}
1325052
func (c *context) metadata(m metadataType, args Args) {
	c.emit(&event{Type: eventMetadata, Name: string(m), Args: args})
}
133199
func (i *item) Metadata() (map[string]interface{}, error) {
	if err := i.ensureInfo(); err != nil {
		return nil, errors.Wrap(err, "retrieving item metadata")
	}
	return i.metadata, nil
}
1345533
func (a *ScriptedMetricAggregation) Meta(metaData map[string]interface{}) *ScriptedMetricAggregation {
	a.meta = metaData
	return a
}
19833
func Metadatify(i interface{}) (Metadata, error) {
	value := reflect.ValueOf(i)
	if value.Kind() == reflect.Map {
		m := map[string]interface{}{}
		for _, k := range value.MapKeys() {
			m[k.String()] = value.MapIndex(k).Interface()
		}
		return Metadata(m), nil
	}
	return nil, errors.New("is not a map")
}
1003554
func (a *MinAggregation) Meta(metaData map[string]interface{}) *MinAggregation {
	a.meta = metaData
	return a
}
1214989
func validateMetadata(meta map[string]string) error {
	if len(meta) > metaMaxKeyPairs {
		return fmt.Errorf("metadata cannot contain more than %d key/value pairs", metaMaxKeyPairs)
	}

	for key, value := range meta {
		if err := validateMetaPair(key, value); err != nil {
			return errwrap.Wrapf(fmt.Sprintf("failed to load metadata pair (%q, %q): {{err}}", key, value), err)
		}
	}

	return nil
}
1013104
func (a *MaxAggregation) Meta(metaData map[string]interface{}) *MaxAggregation {
	a.meta = metaData
	return a
}
1131948
func (a *MovAvgAggregation) Meta(metaData map[string]interface{}) *MovAvgAggregation {
	a.meta = metaData
	return a
}
900400
func (a *CompositeAggregation) Meta(metaData map[string]interface{}) *CompositeAggregation {
	a.meta = metaData
	return a
}
276340
func (a *ValueCountAggregation) Meta(metaData map[string]interface{}) *ValueCountAggregation {
	a.meta = metaData
	return a
}
404107
func (i *Image) Metadata(tagName string, v interface{}) error {
	layerID, ok := i.tags[tagName]
	if !ok {
		return fmt.Errorf("can't find tag '%s' for image '%s'", tagName, i.Name)
	}

	err := i.parseResponse(fmt.Sprintf("v1/images/%s/json", layerID), &v)
	if err != nil {
		return err
	}
	return nil
}
322405
func (res *Resource) Meta(meta *Meta) *Meta {
	if meta.Header == "" {
		meta.Header = meta.Name
	}

	meta.base = res
	meta.updateMeta()
	res.Metas = append(res.Metas, meta)
	return meta
}