Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// NopTags is a trivial, minimum overhead implementation of Tags for which all operations are no-ops.
NopTags = &nopTags{}
)
Functions ¶
Types ¶
type EmptyMapTagsOption ¶
type EmptyMapTagsOption struct{}
EmptyMapTagsOption does not alter the configuration. It can be embedded in another structure to build custom options.
This API is EXPERIMENTAL.
type MapTagsOption ¶
type MapTagsOption interface {
// contains filtered or unexported methods
}
A MapTagsOption sets options.
type MapTagsOptionFunc ¶
type MapTagsOptionFunc func(*mapTags)
MapTagsOptionFunc wraps a function that modifies mapTags into an implementation of the MapTagsOption interface.
type Tags ¶
type Tags interface { // Set sets the given key in the metadata tags. Set(key string, value interface{}) // Get gets if the metadata tags got by the given key exists. Get(key string) (interface{}, bool) // Del deletes the values associated with key. Del(key string) // Values returns a map of key to values. // Do not modify the underlying map, please use Set instead. Values() map[string]interface{} }
Tags is the interface used for storing request tags between Context calls. The default implementation is *not* thread safe, and should be handled only in the context of the request.
func ExtractTags ¶
ExtractTags returns a pre-existing Tags object in the Context. If the context wasn't set in a tag interceptor, a no-op Tag storage is returned that will *not* be propagated in context.
func NewTags ¶
func NewTags(options ...MapTagsOption) Tags
Click to show internal directories.
Click to hide internal directories.