package metadata

import "github.com/influxdata/flux/metadata"

Index

Types

type Metadata

type Metadata map[string][]interface{}

Metadata is made as a standalone package to avoid import cycle: influxd -> flux -> flux/interpreter -> flux/execute -> flux

func (Metadata) Add

func (md Metadata) Add(key string, value interface{})

func (Metadata) AddAll

func (md Metadata) AddAll(other Metadata)

func (Metadata) Del

func (md Metadata) Del(key string)

func (Metadata) Get

func (md Metadata) Get(key string) (interface{}, bool)

func (Metadata) GetAll

func (md Metadata) GetAll(key string) []interface{}

func (Metadata) Range

func (md Metadata) Range(fn func(key string, value interface{}) bool)

Range will iterate over the Metadata. It will invoke the function for each key/value pair. If there are multiple values for a single key, then this will be called with the same key once for each value.

type SyncMetadata

type SyncMetadata struct {
	// contains filtered or unexported fields
}

SyncMetadata is a version of `Metadata` which allows concurrent modifications to it

func NewSyncMetadata

func NewSyncMetadata() *SyncMetadata

func NewSyncMetadataWith

func NewSyncMetadataWith(meta Metadata) *SyncMetadata

func (*SyncMetadata) Add

func (md *SyncMetadata) Add(key string, value interface{})

func (*SyncMetadata) AddAll

func (md *SyncMetadata) AddAll(other Metadata)

func (*SyncMetadata) Del

func (md *SyncMetadata) Del(key string)

func (*SyncMetadata) Get

func (md *SyncMetadata) Get(key string) (interface{}, bool)

func (*SyncMetadata) GetAll

func (md *SyncMetadata) GetAll(key string) []interface{}

func (*SyncMetadata) Range

func (md *SyncMetadata) Range(fn func(key string, value interface{}) bool)

Range will iterate over the SyncMetadata. It will invoke the function for each key/value pair. If there are multiple values for a single key, then this will be called with the same key once for each value.

func (*SyncMetadata) ReadView

func (md *SyncMetadata) ReadView(fn func(meta Metadata))

ReadView provides read access to the underlying `Metadata` map. Since the map may be concurrently modified outside of the closure it should not be allowed to escape it.

func (*SyncMetadata) ReadWriteView

func (md *SyncMetadata) ReadWriteView(fn func(meta *Metadata))

Source Files

metadata.go

Version
v0.196.1 (latest)
Published
Feb 19, 2025
Platform
linux/amd64
Imports
1 packages
Last checked
1 day ago

Tools for package owners.