metadata

package
v0.0.0-...-e964040 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(ctx context.Context, key string) bool

Bool get bool value from metadata in context

func Int64

func Int64(ctx context.Context, key string) int64

Int64 get int64 value from metadata in context

func SetContext

func SetContext(ctx context.Context, key string, val interface{}) context.Context

SetContext .

func String

func String(ctx context.Context, key string) string

String get string value from metadata in context

func Value

func Value(ctx context.Context, key string) interface{}

Value get value from metadata in context return nil if not found

Types

type Metadata

type Metadata map[string]interface{}

func FromContext

func FromContext(ctx context.Context) (Metadata, bool)

FromContext .

func Join

func Join(ms ...Metadata) Metadata

Join joins any number of mds into a single Metadata

func (Metadata) Len

func (m Metadata) Len() int

Len returns the number of items in m

func (Metadata) WithContext

func (m Metadata) WithContext(ctx context.Context) context.Context

WithContext creates a new context with m attached

Jump to

Keyboard shortcuts

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