distributedcontext

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 NewContext

func NewContext(ctx context.Context, keyvalues ...core.KeyValue) context.Context

func WithMap

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

Types

type Map

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

func FromContext

func FromContext(ctx context.Context) Map

func NewEmptyMap

func NewEmptyMap() Map

func NewMap

func NewMap(update MapUpdate) Map

func (Map) Apply

func (m Map) Apply(update MapUpdate) Map

func (Map) Foreach

func (m Map) Foreach(f func(kv core.KeyValue) bool)

func (Map) HasValue

func (m Map) HasValue(k core.Key) bool

func (Map) Len

func (m Map) Len() int

func (Map) Value

func (m Map) Value(k core.Key) (core.Value, bool)

type MapUpdate

type MapUpdate struct {
	SingleKV core.KeyValue
	MultiKV  []core.KeyValue
}

Jump to

Keyboard shortcuts

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