Documentation
¶
Index ¶
- Variables
- func AccountHeaderName() string
- func CleanHasuraSaasHeaders(r *http.Request)
- func ConfigAccountIdHeader() string
- func ConfigJWTHeader() string
- func GetBody(r *http.Request, data interface{}) error
- func JwtHeaderName() string
- func MiddlewareChain(f http.HandlerFunc, m ...Middleware) http.HandlerFunc
- func MiddlewareLogRequest(next http.HandlerFunc) http.HandlerFunc
- func MiddlewareRequestContext(next http.HandlerFunc) http.HandlerFunc
- func MiddlewareSetContentTypeApplicationJson(next http.HandlerFunc) http.HandlerFunc
- func SetCors(res http.ResponseWriter)
- func SetHaderOnRequest(req *http.Request, header string, value string)
- func SetHaderOnResponse(res http.ResponseWriter, header string, value string)
- func SetSslRedirect(req *http.Request, u *url.URL)
- func WriteBody(w http.ResponseWriter, data interface{}) error
- func WriteError(res http.ResponseWriter, e error)
- func WriteResponse(res http.ResponseWriter, statusCode int, data interface{})
- type Middleware
Constants ¶
This section is empty.
Variables ¶
View Source
var Mapping map[string]int = map[string]int{ errorx.IllegalArgument.FullName(): http.StatusBadRequest, errorx.IllegalState.FullName(): http.StatusInternalServerError, errorx.IllegalFormat.FullName(): http.StatusBadRequest, errorx.InitializationFailed.FullName(): http.StatusInternalServerError, errorx.DataUnavailable.FullName(): http.StatusNotFound, errorx.UnsupportedOperation.FullName(): http.StatusBadRequest, errorx.RejectedOperation.FullName(): http.StatusBadRequest, errorx.Interrupted.FullName(): http.StatusBadRequest, errorx.AssertionFailed.FullName(): http.StatusBadRequest, errorx.InternalError.FullName(): http.StatusInternalServerError, errorx.ExternalError.FullName(): http.StatusInternalServerError, errorx.ConcurrentUpdate.FullName(): http.StatusInternalServerError, errorx.TimeoutElapsed.FullName(): http.StatusRequestTimeout, errorx.NotImplemented.FullName(): http.StatusInternalServerError, errorx.UnsupportedVersion.FullName(): http.StatusInternalServerError, }
Functions ¶
func AccountHeaderName ¶
func AccountHeaderName() string
func CleanHasuraSaasHeaders ¶
func ConfigAccountIdHeader ¶
func ConfigAccountIdHeader() string
func ConfigJWTHeader ¶
func ConfigJWTHeader() string
func JwtHeaderName ¶
func JwtHeaderName() string
func MiddlewareChain ¶
func MiddlewareChain(f http.HandlerFunc, m ...Middleware) http.HandlerFunc
func MiddlewareLogRequest ¶
func MiddlewareLogRequest(next http.HandlerFunc) http.HandlerFunc
func MiddlewareRequestContext ¶
func MiddlewareRequestContext(next http.HandlerFunc) http.HandlerFunc
func MiddlewareSetContentTypeApplicationJson ¶
func MiddlewareSetContentTypeApplicationJson(next http.HandlerFunc) http.HandlerFunc
func SetCors ¶
func SetCors(res http.ResponseWriter)
func SetHaderOnResponse ¶
func SetHaderOnResponse(res http.ResponseWriter, header string, value string)
func SetSslRedirect ¶
SetSslRedirect Update the headers to allow for SSL redirection
func WriteBody ¶
func WriteBody(w http.ResponseWriter, data interface{}) error
func WriteError ¶
func WriteError(res http.ResponseWriter, e error)
func WriteResponse ¶
func WriteResponse(res http.ResponseWriter, statusCode int, data interface{})
Types ¶
type Middleware ¶
type Middleware func(http.HandlerFunc) http.HandlerFunc
Click to show internal directories.
Click to hide internal directories.