usercontext

package
v6.5.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2018 License: MIT Imports: 1 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context, u *User) context.Context

NewContext returns a new Context that carries value u.

Types

type User

type User struct {
	ID string
}

User is the type of value stored in the Contexts.

func FromContext

func FromContext(ctx context.Context) *User

FromContext returns the User value stored in context. If there is no user in the context, this function will crash

Jump to

Keyboard shortcuts

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