Documentation
¶
Overview ¶
The `context` package provides functions to embed parameters within a context object, and also functions to create contexts.
Index ¶
- func Address(ctx context.Context) string
- func Admin(ctx context.Context) bool
- func ContextForSignal(signals ...os.Signal) context.Context
- func DumpContext(ctx context.Context, w io.Writer)
- func Label(ctx context.Context) string
- func Name(ctx context.Context) string
- func NameLabel(ctx context.Context) string
- func Path(ctx context.Context) string
- func ReqAdmin(req *http.Request) bool
- func ReqName(req *http.Request) string
- func ReqParams(req *http.Request) []string
- func ReqPrefix(req *http.Request) string
- func WithAddress(ctx context.Context, addr string) context.Context
- func WithAdmin(ctx context.Context, admin bool) context.Context
- func WithCancel() (context.Context, context.CancelFunc)
- func WithName(ctx context.Context, name string) context.Context
- func WithNameLabel(ctx context.Context, name, label string) context.Context
- func WithPath(ctx context.Context, path string) context.Context
- func WithPrefixParams(ctx context.Context, prefix string, params []string) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextForSignal ¶
ContextForSignal returns a context object which is cancelled when a signal is received. It returns nil if no signal parameter is provided
func DumpContext ¶
Stringify the context values to an io.Writer object
func Path ¶ added in v1.1.1
Return the path parameter from the context, or zero value if not defined
func WithAddress ¶
Return a context with the given address string
func WithCancel ¶
func WithCancel() (context.Context, context.CancelFunc)
Return a context object with a function to cancel the context
func WithNameLabel ¶
Return a context with the given name and label
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.