context

package
v1.4.2-0...-259a0fb Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2015 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RequestID is the unique ID for each http request
	RequestID = "request-id"

	// APIVersion is the client's requested API version
	APIVersion = "api-version"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	context.Context
}

Context is just our own wrapper for the golang 'Context' - mainly so we can add our over version of the funcs.

func Background

func Background() Context

Background creates a new Context based on golang's default one.

func WithValue

func WithValue(ctx Context, key, value interface{}) Context

WithValue will return a Context that has this new key/value pair associated with it. Just uses the golang version but then wraps it.

func (Context) RequestID

func (ctx Context) RequestID() string

RequestID is a utility func to make it easier to get the request ID associated with this Context/request.

func (Context) Version

func (ctx Context) Version() version.Version

Version is a utility func to make it easier to get the API version string associated with this Context/request.

Jump to

Keyboard shortcuts

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