Documentation ¶ Index ¶ func ErrorFrom(ctx context.Context) error func WithError(parent context.Context, err error) context.Context func WithToken(parent context.Context, token *Token) context.Context type Middleware type Token func TokenFrom(ctx context.Context) *Token Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func ErrorFrom ¶ func ErrorFrom(ctx context.Context) error ErrorFrom returns the login error from the context. func WithError ¶ func WithError(parent context.Context, err error) context.Context WithError returns a parent context with the error. func WithToken ¶ func WithToken(parent context.Context, token *Token) context.Context WithToken returns a parent context with the token. Types ¶ type Middleware ¶ type Middleware interface { // Handler returns a http.Handler that runs h at the // completion of the authorization flow. The authorization // results are available to h in the http.Request context. Handler(h http.Handler) http.Handler } Middleware provides login middleware. type Token ¶ type Token struct { Access string Refresh string Expires time.Time } Token represents an authorization token. func TokenFrom ¶ func TokenFrom(ctx context.Context) *Token TokenFrom returns the login token rom the context. Source Files ¶ View all Source files login.go Directories ¶ Show internal Expand all Path Synopsis bitbucket gitea gitee github gitlab gogs internal oauth1 oauth2 logger stash Click to show internal directories. Click to hide internal directories.