wookie

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const HeaderName = "Warrant-Token"
View Source
const Latest = "latest"

Variables

This section is empty.

Functions

func ContainsLatest

func ContainsLatest(ctx context.Context) bool

Returns true if ctx contains wookie set to 'latest', false otherwise.

func GetWookieFromRequestContext added in v0.39.0

func GetWookieFromRequestContext(ctx context.Context) (string, error)

func WithLatest

func WithLatest(parent context.Context) context.Context

Return a context with wookie set to 'latest'.

func WookieMiddleware

func WookieMiddleware(next http.Handler) http.Handler

Types

type Token added in v0.39.0

type Token struct {
	ID        int64
	Version   int64
	Timestamp time.Time
}

func FromString added in v0.39.0

func FromString(wookieString string) (Token, error)

De-serialize token from string (from header).

func (Token) String added in v0.39.0

func (t Token) String() string

Get string representation of token (to set as header).

type WookieCtxKey added in v0.39.0

type WookieCtxKey struct{}

Jump to

Keyboard shortcuts

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