requestctx

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package requestctx provides access to special fields in the http request's context

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithID

func ContextWithID(ctx context.Context, val string) context.Context

ContextWithID adds the user name to the context

func ContextWithUser

func ContextWithUser(ctx context.Context, val string) context.Context

ContextWithUser adds the user name to the context

func ID

func ID(ctx context.Context) string

ID returns the user name from the context

func User

func User(ctx context.Context) string

User returns the user name from the context

Types

type IDKey

type IDKey struct{}

IDKey is the unique key to lookup the request ID from the request's context

type UserKey

type UserKey struct{}

UserKey is the unique key to lookup the username from the request's context

Jump to

Keyboard shortcuts

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