tag

package
v0.0.0-...-30f5ca6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EmptyMap = NewMap(core.KeyValue{}, nil, core.Mutator{}, nil)
)

Functions

func Delete

func Delete(k core.Key) core.Mutator

func Do

func Do(ctx context.Context, f func(ctx context.Context))

Note: the golang pprof.Do API forces this memory allocation, we should file an issue about that. (There's a TODO in the source.)

func Insert

func Insert(kv core.KeyValue) core.Mutator

func New

func New(name string, opts ...Option) core.Key

func NewContext

func NewContext(ctx context.Context, mutators ...core.Mutator) context.Context

func NewMeasure

func NewMeasure(name string, opts ...Option) core.Measure

func Update

func Update(kv core.KeyValue) core.Mutator

func Upsert

func Upsert(kv core.KeyValue) core.Mutator

func WithMap

func WithMap(ctx context.Context, m Map) context.Context

Types

type Map

type Map interface {
	// TODO combine these four into a struct
	Apply(a1 core.KeyValue, attributes []core.KeyValue, m1 core.Mutator, mutators []core.Mutator) Map

	Value(core.Key) (core.Value, bool)
	HasValue(core.Key) bool

	Len() int

	Foreach(func(kv core.KeyValue) bool)
}

func FromContext

func FromContext(ctx context.Context) Map

func NewMap

func NewMap(a1 core.KeyValue, attributes []core.KeyValue, m1 core.Mutator, mutators []core.Mutator) Map

type Option

type Option func(*registeredKey)

func WithDescription

func WithDescription(desc string) Option

WithDescription applies provided description.

func WithUnit

func WithUnit(unit unit.Unit) Option

WithUnit applies provided unit.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL