Documentation
¶
Index ¶
- func DisableCache(w http.ResponseWriter)
- func EnableCors(w http.ResponseWriter)
- func ProcessEtags(w http.ResponseWriter, r *http.Request) int
- func RequireAdminAuth(handler http.HandlerFunc) http.HandlerFunc
- func RequireExternalAPIAccessToken(scope string, handler ExternalAccessTokenHandlerFunc) http.HandlerFunc
- func RequireUserAccessToken(handler http.HandlerFunc) http.HandlerFunc
- func SetCachingHeaders(w http.ResponseWriter, r *http.Request)
- func SetHeaders(w http.ResponseWriter)
- type ExternalAccessTokenHandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableCache ¶
func DisableCache(w http.ResponseWriter)
DisableCache writes the disable cache header on the responses.
func EnableCors ¶
func EnableCors(w http.ResponseWriter)
EnableCors enables the CORS header on the responses.
func ProcessEtags ¶
func ProcessEtags(w http.ResponseWriter, r *http.Request) int
ProcessEtags gets and sets ETags for caching purposes.
func RequireAdminAuth ¶
func RequireAdminAuth(handler http.HandlerFunc) http.HandlerFunc
RequireAdminAuth wraps a handler requiring HTTP basic auth for it using the given the stream key as the password and and a hardcoded "admin" for username.
func RequireExternalAPIAccessToken ¶
func RequireExternalAPIAccessToken(scope string, handler ExternalAccessTokenHandlerFunc) http.HandlerFunc
RequireExternalAPIAccessToken will validate a 3rd party access token.
func RequireUserAccessToken ¶
func RequireUserAccessToken(handler http.HandlerFunc) http.HandlerFunc
RequireUserAccessToken will validate a provided user's access token and make sure the associated user is enabled. Not to be used for validating 3rd party access.
func SetCachingHeaders ¶
func SetCachingHeaders(w http.ResponseWriter, r *http.Request)
SetCachingHeaders will set the cache control header of a response.
func SetHeaders ¶
func SetHeaders(w http.ResponseWriter)
SetHeaders will set our global headers for web resources.
Types ¶
type ExternalAccessTokenHandlerFunc ¶
type ExternalAccessTokenHandlerFunc func(user.ExternalAPIUser, http.ResponseWriter, *http.Request)
ExternalAccessTokenHandlerFunc is a function that is called after validing access.