wookie

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 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 AddAsResponseHeader added in v0.42.0

func AddAsResponseHeader(w http.ResponseWriter, token *Token)

func ContainsLatest

func ContainsLatest(ctx context.Context) bool

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

func WarrantTokenMiddleware added in v0.43.0

func WarrantTokenMiddleware(next http.Handler) http.Handler

func WithLatest

func WithLatest(parent context.Context) context.Context

Return a context with wookie set to 'latest'.

Types

type ClientPassedWookieCtxKey added in v0.42.0

type ClientPassedWookieCtxKey struct{}

type ServerCreatedWookieCtxKey added in v0.42.0

type ServerCreatedWookieCtxKey struct{}

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 GetClientPassedWookieFromRequestContext added in v0.42.0

func GetClientPassedWookieFromRequestContext(ctx context.Context) (*Token, error)

func GetServerCreatedWookieFromRequestContext added in v0.42.0

func GetServerCreatedWookieFromRequestContext(ctx context.Context) (*Token, error)

func (Token) String added in v0.39.0

func (t Token) String() string

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

type WarrantTokenCtxKey added in v0.43.0

type WarrantTokenCtxKey struct{}

Jump to

Keyboard shortcuts

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