Documentation ¶
Index ¶
- func Clearln()
- func ParseBasicAuthHeader(header string) (string, string)
- func ParseParams(str string) (map[string]string, error)
- func PresentAuthScreen(w http.ResponseWriter, r *http.Request, flow int)
- func RenderTemplate(w http.ResponseWriter, r *http.Request, templateName string, status int, ...)
- func ShowError(w http.ResponseWriter, r *http.Request, status int, title string, desc string)
- func ShowJSONError(w http.ResponseWriter, r *http.Request, status int, data interface{})
- func Sleep(duration time.Duration)
- type RequestError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseBasicAuthHeader ¶
ParseBasicAuthHeader decodes the Basic Auth header. First checks if the string contains the substring "Basic" and strips it off if present. Returns the username:password pair
func ParseParams ¶
ParseParams parses a URL string containing application/x-www-urlencoded parameters and returns a map of string key-value pairs of the same
func PresentAuthScreen ¶
func PresentAuthScreen(w http.ResponseWriter, r *http.Request, flow int)
PresentAuthScreen shows the authorization screen to the user
func RenderTemplate ¶
func RenderTemplate(w http.ResponseWriter, r *http.Request, templateName string, status int, data interface{})
RenderTemplate renders the template with the given template, sets the status code for the response
func ShowJSONError ¶
func ShowJSONError(w http.ResponseWriter, r *http.Request, status int, data interface{})
ShowJSONError presents the error to the user or application in the form of a JSON string
Types ¶
type RequestError ¶
RequestError is used as response for failed requests. Using the necessary structures mentioned in RFC 6749 Section 4.1.2.1 (https://tools.ietf.org/html/rfc6749#section-4.1.2.1) error_uri is ignored since this is not a real API and has no documentation. state is ignored because it is ignored by flowHandlers.