context

package
v0.1.0-rc2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Background

func Background() types.Context

Background initializes a new, empty context.

func Client

func Client(ctx context.Context) (types.Client, error)

Client returns this context's storage driver.

func HTTPRequest

func HTTPRequest(ctx context.Context) *http.Request

HTTPRequest returns the *http.Request associated with ctx using NewContext.

func InstanceID

func InstanceID(ctx context.Context) (*types.InstanceID, error)

InstanceID gets the context's instance ID.

func InstanceIDsByService

func InstanceIDsByService(
	ctx context.Context) (map[string]*types.InstanceID, error)

InstanceIDsByService gets the context's service to instance IDs map.

func LocalDevices

func LocalDevices(ctx context.Context) (tval map[string]string, err error)

LocalDevices gets the context's local devices map.

func LocalDevicesByService

func LocalDevicesByService(
	ctx context.Context) (map[string]map[string]string, error)

LocalDevicesByService gets the context's service to local devices map.

func Profile

func Profile(ctx context.Context) (string, error)

Profile gets the context's profile.

func Route

func Route(ctx context.Context) (string, error)

Route gets the context's route name.

func ServerName

func ServerName(ctx context.Context) (string, error)

ServerName returns the context's server name.

func ServiceName

func ServiceName(ctx context.Context) (string, error)

ServiceName returns the name of the context's service.

func TransactionCreated

func TransactionCreated(ctx context.Context) (time.Time, error)

TransactionCreated gets the context's transaction created timstamp.

func TransactionID

func TransactionID(ctx context.Context) (string, error)

TransactionID gets the context's transaction ID.

func WithClient

func WithClient(
	parent context.Context, val types.Client) types.Context

WithClient returns a context with the provided client.

func WithContextID

func WithContextID(
	parent context.Context, id, val string) types.Context

WithContextID returns a context with the provided context ID information. The context ID is often used with logging to identify a log statement's origin.

func WithContextSID

func WithContextSID(
	parent context.Context, id fmt.Stringer, value string) types.Context

WithContextSID is the same as the WithContextID function except this variant only accepts fmt.Stringer values for its id argument.

func WithHTTPRequest

func WithHTTPRequest(ctx types.Context, val *http.Request) types.Context

WithHTTPRequest returns a context with the provided HTTP request.

func WithInstanceID

func WithInstanceID(
	parent context.Context, val *types.InstanceID) types.Context

WithInstanceID returns a context with the provided instance ID.

func WithInstanceIDsByService

func WithInstanceIDsByService(
	parent context.Context, val map[string]*types.InstanceID) types.Context

WithInstanceIDsByService returns a context with the provided instance ID map.

func WithLocalDevices

func WithLocalDevices(
	parent context.Context, val map[string]string) types.Context

WithLocalDevices returns a context with the provided local devices map.

func WithLocalDevicesByService

func WithLocalDevicesByService(
	parent context.Context, val map[string]map[string]string) types.Context

WithLocalDevicesByService returns a context with the provided service to

instance ID map.

func WithProfile

func WithProfile(
	parent context.Context, val string) types.Context

WithProfile returns a context with the provided profile.

func WithRoute

func WithRoute(parent context.Context, val string) types.Context

WithRoute returns a contex with the provided route name.

func WithServiceName

func WithServiceName(parent context.Context, val string) types.Context

WithServiceName returns a contex with the provided service name.

func WithTransactionCreated

func WithTransactionCreated(
	parent context.Context, val time.Time) types.Context

WithTransactionCreated returns a context with the provided transaction created timestamp.

func WithTransactionID

func WithTransactionID(parent context.Context, val string) types.Context

WithTransactionID returns a context with the provided transaction ID.

func WithValue

func WithValue(
	parent context.Context,
	key interface{},
	val interface{}) types.Context

WithValue returns a context with the provided value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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