Documentation
¶
Index ¶
- func ErrorRedirect(w http.ResponseWriter, r *http.Request, redirectURI *url.URL, errCode int, ...)
- func GetAccessPayload(r *http.Request) (*jwt.AccessPayload, *perror.PlutoError)
- func GetBaseURL(r *http.Request) string
- func GetQueryString(query url.Values, except ...string) string
- func GetRequestData(r *http.Request, reciver interface{}) *perror.PlutoError
- func PlutoLog(logger *log.PlutoLog, pe *perror.PlutoError, r *http.Request)
- func RedirectWithFragment(to string, query url.Values, w http.ResponseWriter, r *http.Request)
- func RedirectWithQueryString(to string, query url.Values, w http.ResponseWriter, r *http.Request)
- func ResponseError(plutoError *perror.PlutoError, w http.ResponseWriter) *perror.PlutoError
- func ResponseHTMLError(file string, data interface{}, r *http.Request, w http.ResponseWriter, ...) *perror.PlutoError
- func ResponseHTMLOK(file string, data interface{}, r *http.Request, w http.ResponseWriter) *perror.PlutoError
- func ResponseOK(body interface{}, w http.ResponseWriter) *perror.PlutoError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorRedirect ¶
func ErrorRedirect(w http.ResponseWriter, r *http.Request, redirectURI *url.URL, errCode int, state, responseType string)
Helper function to handle redirecting failed or declined authorization
func GetAccessPayload ¶
func GetAccessPayload(r *http.Request) (*jwt.AccessPayload, *perror.PlutoError)
func GetBaseURL ¶
func GetQueryString ¶
Returns string encoded query string of the request
func GetRequestData ¶
func GetRequestData(r *http.Request, reciver interface{}) *perror.PlutoError
func RedirectWithFragment ¶
Redirects to a new path with the query string moved to the URL fragment
func RedirectWithQueryString ¶
Redirects to a new path while keeping current request's query string
func ResponseError ¶
func ResponseError(plutoError *perror.PlutoError, w http.ResponseWriter) *perror.PlutoError
func ResponseHTMLError ¶
func ResponseHTMLError(file string, data interface{}, r *http.Request, w http.ResponseWriter, status int) *perror.PlutoError
func ResponseHTMLOK ¶
func ResponseHTMLOK(file string, data interface{}, r *http.Request, w http.ResponseWriter) *perror.PlutoError
func ResponseOK ¶
func ResponseOK(body interface{}, w http.ResponseWriter) *perror.PlutoError
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.