go-micro: github.com/micro/go-micro/metadata Index | Files

package metadata

import "github.com/micro/go-micro/metadata"

Package metadata is a way of defining message headers

Index

Package Files

metadata.go

func Get Uses

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

Get returns a single value from metadata in the context

func MergeContext Uses

func MergeContext(ctx context.Context, patchMd Metadata, overwrite bool) context.Context

MergeContext merges metadata to existing metadata, overwriting if specified

func NewContext Uses

func NewContext(ctx context.Context, md Metadata) context.Context

NewContext creates a new context with the given metadata

func Set Uses

func Set(ctx context.Context, k, v string) context.Context

Set add key with val to metadata

type Metadata Uses

type Metadata map[string]string

Metadata is our way of representing request headers internally. They're used at the RPC level and translate back and forth from Transport headers.

func Copy Uses

func Copy(md Metadata) Metadata

Copy makes a copy of the metadata

func FromContext Uses

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

FromContext returns metadata from the given context

Package metadata imports 2 packages (graph) and is imported by 353 packages. Updated 2020-02-22. Refresh now. Tools for package owners.