Documentation ¶
Index ¶
- Variables
- type ContextKey
- type Middleware
- func (m *Middleware) AppSession(next http.Handler) http.Handler
- func (m *Middleware) BasicAuth(next http.Handler) http.Handler
- func (m *Middleware) CommonHeaders(next http.Handler) http.Handler
- func (m *Middleware) FeverAuth(next http.Handler) http.Handler
- func (m *Middleware) HeaderConfig(next http.Handler) http.Handler
- func (m *Middleware) Logging(next http.Handler) http.Handler
- func (m *Middleware) UserSession(next http.Handler) http.Handler
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"} // PocketRequestTokenContextKey is the context key for Pocket Request Token. PocketRequestTokenContextKey = &ContextKey{"PocketRequestToken"} )
Functions ¶
This section is empty.
Types ¶
type ContextKey ¶
type ContextKey struct {
// contains filtered or unexported fields
}
ContextKey represents a context key.
func (ContextKey) String ¶
func (c ContextKey) String() string
type Middleware ¶
type Middleware struct {
// contains filtered or unexported fields
}
Middleware handles different middleware handlers.
func (*Middleware) AppSession ¶
func (m *Middleware) AppSession(next http.Handler) http.Handler
AppSession handles application session middleware.
func (*Middleware) BasicAuth ¶
func (m *Middleware) BasicAuth(next http.Handler) http.Handler
BasicAuth handles HTTP basic authentication.
func (*Middleware) CommonHeaders ¶
func (m *Middleware) CommonHeaders(next http.Handler) http.Handler
CommonHeaders sends common HTTP headers.
func (*Middleware) FeverAuth ¶
func (m *Middleware) FeverAuth(next http.Handler) http.Handler
FeverAuth handles Fever API authentication.
func (*Middleware) HeaderConfig ¶
func (m *Middleware) HeaderConfig(next http.Handler) http.Handler
HeaderConfig changes config values according to HTTP headers.
func (*Middleware) Logging ¶
func (m *Middleware) Logging(next http.Handler) http.Handler
Logging logs the HTTP request.
func (*Middleware) UserSession ¶
func (m *Middleware) UserSession(next http.Handler) http.Handler
UserSession handles the user session middleware.
Click to show internal directories.
Click to hide internal directories.