route

package
Version: v1.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

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 GetBaseURL(r *http.Request) string

func GetQueryString

func GetQueryString(query url.Values, except ...string) string

Returns string encoded query string of the request

func GetRequestData

func GetRequestData(r *http.Request, reciver interface{}) *perror.PlutoError

func PlutoLog

func PlutoLog(logger *log.PlutoLog, pe *perror.PlutoError, r *http.Request)

func RedirectWithFragment

func RedirectWithFragment(to string, query url.Values, w http.ResponseWriter, r *http.Request)

Redirects to a new path with the query string moved to the URL fragment

func RedirectWithQueryString

func RedirectWithQueryString(to string, query url.Values, w http.ResponseWriter, r *http.Request)

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.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL