Categorygithub.com/rubanbydesign/context
modulepackage
0.0.0-20191015185608-c90fd6894eea
Repository: https://github.com/rubanbydesign/context.git
Documentation: pkg.go.dev

# README

A drop-in replacement for the "context" and "golang.org/x/net/context" packages which works seamlessly across all Go 1 versions in standard Go environments, and also Google App Engine Go environments

# Functions

Background returns a new background context.
Hostname returns the hostname of the current instance.
NewContext creates a new context associated with the request.
SetCode sets the HTTP response code associated with the context.
WithDeadline returns a copy of the parent context with the deadline adjusted to be no later than d.
WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)).
WithValue returns a copy of parent in which the value associated with key is val.

# Variables

Context key location definitions.
Context key location definitions.
Context key location definitions.
Context key location definitions.
Context key location definitions.
Context key location definitions.
Context key location definitions.
Context key location definitions.
Context key location definitions.
Namespace is a overrideable function which returns the namespace associated with the given context.

# Interfaces

Context has the same interface as "context" and "golang.org/x/net/context" to handle imports in all go version.

# Type aliases

CancelFunc is a context cancel func, matching the "context".CancelFunc interface.
Key is a string type for context value key names.