capecontext

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthToken

func AuthToken(ctx context.Context) *base64.Value

AuthToken returns the auth token stored on the given context.

Returns nil if the token is not available on the context.

func Logger

func Logger(ctx context.Context) zerolog.Logger

Logger returns the logger stored on a given context

func RequestID

func RequestID(ctx context.Context) uuid.UUID

RequestID returns the request id stored on a given context

func Session

func Session(ctx context.Context) *auth.Session

Session returns the session stored on the given context

Types

type ContextKey

type ContextKey string

ContextKey is a type alias used for storing data in a context

const (
	// RequestIDContextKey is the name of the key stored on the contet
	RequestIDContextKey ContextKey = "request-id"

	// LoggerContextKey is the name of the logger key stored on the context
	LoggerContextKey ContextKey = "logger"

	// AuthTokenContextKey is the name of the auth token stored on the context
	AuthTokenContextKey ContextKey = "auth-token"

	// SessionContextKey is the name of the session key stored on the context
	SessionContextKey ContextKey = "session"
)

Jump to

Keyboard shortcuts

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