Documentation
¶
Index ¶
- func CSRF(r *http.Request) string
- func ClientIP(r *http.Request) string
- func CookieValue(r *http.Request, name string) string
- func FindClientIP(r *http.Request) string
- func FindRemoteIP(r *http.Request) string
- func FlashErrorMessage(r *http.Request) string
- func FlashMessage(r *http.Request) string
- func FormInt64Value(r *http.Request, param string) int64
- func GoolgeReaderToken(r *http.Request) string
- func HasQueryParam(r *http.Request, param string) bool
- func IsAdminUser(r *http.Request) bool
- func IsAuthenticated(r *http.Request) bool
- func OAuth2State(r *http.Request) string
- func PocketRequestToken(r *http.Request) string
- func QueryInt64Param(r *http.Request, param string, defaultValue int64) int64
- func QueryIntParam(r *http.Request, param string, defaultValue int) int
- func QueryStringParam(r *http.Request, param, defaultValue string) string
- func QueryStringParamList(r *http.Request, param string) []string
- func RouteInt64Param(r *http.Request, param string) int64
- func RouteStringParam(r *http.Request, param string) string
- func SessionID(r *http.Request) string
- func UserID(r *http.Request) int64
- func UserLanguage(r *http.Request) string
- func UserSessionToken(r *http.Request) string
- func UserTheme(r *http.Request) string
- func UserTimezone(r *http.Request) string
- type ContextKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CookieValue ¶
CookieValue returns the cookie value.
func FindClientIP ¶
FindClientIP returns the client real IP address based on trusted Reverse-Proxy HTTP headers.
func FindRemoteIP ¶
FindRemoteIP returns remote client IP address.
func FlashErrorMessage ¶
FlashErrorMessage returns the message error message if any.
func FlashMessage ¶
FlashMessage returns the message message if any.
func FormInt64Value ¶
FormInt64Value returns a form value as integer.
func GoolgeReaderToken ¶
GoolgeReaderToken returns the google reader token if it exists.
func HasQueryParam ¶
HasQueryParam checks if the query string contains the given parameter.
func IsAdminUser ¶
IsAdminUser checks if the logged user is administrator.
func IsAuthenticated ¶
IsAuthenticated returns a boolean if the user is authenticated.
func OAuth2State ¶
OAuth2State returns the current OAuth2 state.
func PocketRequestToken ¶
PocketRequestToken returns the Pocket Request Token if any.
func QueryInt64Param ¶
QueryInt64Param returns a query string parameter as int64.
func QueryIntParam ¶
QueryIntParam returns a query string parameter as integer.
func QueryStringParam ¶
QueryStringParam returns a query string parameter as string.
func QueryStringParamList ¶
QueryStringParamList returns all values associated to the parameter.
func RouteInt64Param ¶
RouteInt64Param returns an URL route parameter as int64.
func RouteStringParam ¶
RouteStringParam returns a URL route parameter as string.
func UserLanguage ¶
UserLanguage get the locale used by the current logged user.
func UserSessionToken ¶
UserSessionToken returns the current user session token.
func UserTimezone ¶
UserTimezone returns the timezone used by the logged user.
Types ¶
type ContextKey ¶
type ContextKey int
ContextKey represents a context key.
const ( UserIDContextKey ContextKey = iota UserTimezoneContextKey IsAdminUserContextKey IsAuthenticatedContextKey UserSessionTokenContextKey UserLanguageContextKey UserThemeContextKey SessionIDContextKey CSRFContextKey OAuth2StateContextKey FlashMessageContextKey FlashErrorMessageContextKey PocketRequestTokenContextKey ClientIPContextKey GoogleReaderToken )
List of context keys.