Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // UserIDContextKey is the context key used to store the user ID. UserIDContextKey = &ContextKey{"UserID"} // UserTimezoneContextKey is the context key used to store the user timezone. UserTimezoneContextKey = &ContextKey{"UserTimezone"} // IsAdminUserContextKey is the context key used to store the user role. IsAdminUserContextKey = &ContextKey{"IsAdminUser"} // IsAuthenticatedContextKey is the context key used to store the authentication flag. IsAuthenticatedContextKey = &ContextKey{"IsAuthenticated"} // UserSessionTokenContextKey is the context key used to store the user session ID. UserSessionTokenContextKey = &ContextKey{"UserSessionToken"} // UserLanguageContextKey is the context key to store user language. UserLanguageContextKey = &ContextKey{"UserLanguageContextKey"} // SessionIDContextKey is the context key used to store the session ID. SessionIDContextKey = &ContextKey{"SessionID"} // CSRFContextKey is the context key used to store CSRF token. CSRFContextKey = &ContextKey{"CSRF"} // OAuth2StateContextKey is the context key used to store OAuth2 state. OAuth2StateContextKey = &ContextKey{"OAuth2State"} // FlashMessageContextKey is the context key used to store a flash message. FlashMessageContextKey = &ContextKey{"FlashMessage"} // FlashErrorMessageContextKey is the context key used to store a flash error message. FlashErrorMessageContextKey = &ContextKey{"FlashErrorMessage"} )
Functions ¶
This section is empty.
Types ¶
type BasicAuthMiddleware ¶
type BasicAuthMiddleware struct {
// contains filtered or unexported fields
}
BasicAuthMiddleware is the middleware for HTTP Basic authentication.
func NewBasicAuthMiddleware ¶
func NewBasicAuthMiddleware(s *storage.Storage) *BasicAuthMiddleware
NewBasicAuthMiddleware returns a new BasicAuthMiddleware.
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
Chain handles a list of middlewares.
type ContextKey ¶
type ContextKey struct {
// contains filtered or unexported fields
}
ContextKey represents a context key.
func (ContextKey) String ¶
func (c ContextKey) String() string
type FeverMiddleware ¶
type FeverMiddleware struct {
// contains filtered or unexported fields
}
FeverMiddleware is the middleware that handles Fever API.
func NewFeverMiddleware ¶
func NewFeverMiddleware(s *storage.Storage) *FeverMiddleware
NewFeverMiddleware returns a new FeverMiddleware.
type Middleware ¶
Middleware represents a HTTP middleware.
type SessionMiddleware ¶
type SessionMiddleware struct {
// contains filtered or unexported fields
}
SessionMiddleware represents a session middleware.
func NewSessionMiddleware ¶
func NewSessionMiddleware(cfg *config.Config, store *storage.Storage) *SessionMiddleware
NewSessionMiddleware returns a new SessionMiddleware.
type UserSessionMiddleware ¶
type UserSessionMiddleware struct {
// contains filtered or unexported fields
}
UserSessionMiddleware represents a user session middleware.
func NewUserSessionMiddleware ¶
func NewUserSessionMiddleware(s *storage.Storage, r *mux.Router) *UserSessionMiddleware
NewUserSessionMiddleware returns a new UserSessionMiddleware.
Click to show internal directories.
Click to hide internal directories.