Categorygithub.com/dmitriymv/context
modulepackage
0.0.0-20160716142520-798504f34ace
Repository: https://github.com/dmitriymv/context.git
Documentation: pkg.go.dev

# README

context

Build Status GoDoc Coverage Status

Context helpers inspired by https://godoc.org/github.com/docker/distribution/context.

Documentation

Differences:

  1. Package github.com/satori/go.uuid used for uuid generation instead of github.com/docker/distribution/uuid
  2. Package github.com/apex/log used to log instead of github.com/Sirupsen/logrus
  3. gorilla mux extracted because I don't need it.

# Packages

No description provided by the author

# Functions

Background returns a non-nil, empty Context.
GetLogger returns the logger from the current context, if present.
GetLoggerWithField returns a logger instance with the specified field key and value without affecting the context.
GetLoggerWithFields returns a logger instance with the specified fields without affecting the context.
GetStringValue returns a string value from the context.
GetVersion returns the application version from the context.
Since looks up key, which should be a time.Time, and returns the duration since that time.
WithLogger creates a new context with provided logger.
WithTrace allocates a traced timing span in a new context.
WithValue returns a copy of parent in which the value associated with key is val.
WithValues returns a context that proxies lookups through a map.
WithVersion stores the application version in the context.

# Interfaces

Logger provides a leveled-logging interface.