metautils

package
v0.0.0-...-a91edef Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSingle

func GetSingle(ctx context.Context, keyName string) (string, bool)

GetSingle extracts a single-value metadata key from Context. First return is the value of the key, followed by a bool indicator. The bool indicator being false means the string should be discarded. It can be false if the context has no metadata at all, the key in metadata doesn't exist or there are multiple values.

func SetSingle

func SetSingle(ctx context.Context, keyName string, keyValue string) context.Context

SetSingle sets or overrides a metadata key to be single value in the Context. It returns a new context.Context object that contains a *copy* of the metadata inside the given context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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