Documentation ¶
Index ¶
- Variables
- func NewCORSHandler(opts *CORSOptions, nextHandler http.Handler) http.Handler
- func NewCustomLogsHandler(bodies []hcl.Body, next http.Handler, handlerName string) http.Handler
- type AllowedMethodsHandler
- type CORS
- type CORSOptions
- type CustomLogs
- type MetricsHandler
- type Next
- type NextHandler
- type TraceHandler
- type UID
- type UIDFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultEndpointAllowedMethods = []string{ http.MethodGet, http.MethodHead, http.MethodPost, http.MethodPut, http.MethodPatch, http.MethodDelete, http.MethodOptions, }
View Source
var DefaultFileSpaAllowedMethods = []string{ http.MethodGet, http.MethodHead, }
Functions ¶
func NewCORSHandler ¶
func NewCORSHandler(opts *CORSOptions, nextHandler http.Handler) http.Handler
Types ¶
type AllowedMethodsHandler ¶
type AllowedMethodsHandler struct {
// contains filtered or unexported fields
}
func NewAllowedMethodsHandler ¶
func NewAllowedMethodsHandler(allowedMethods, defaultAllowedMethods []string, allowedHandler, notAllowedHandler http.Handler) *AllowedMethodsHandler
func (*AllowedMethodsHandler) Child ¶
func (a *AllowedMethodsHandler) Child() http.Handler
func (*AllowedMethodsHandler) MethodAllowed ¶
func (a *AllowedMethodsHandler) MethodAllowed(method string) bool
func (*AllowedMethodsHandler) ServeHTTP ¶
func (a *AllowedMethodsHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
type CORS ¶
type CORS struct {
// contains filtered or unexported fields
}
func (*CORS) ServeNextHTTP ¶
type CORSOptions ¶
type CORSOptions struct { AllowedOrigins []string AllowCredentials bool MaxAge string // contains filtered or unexported fields }
func NewCORSOptions ¶
func NewCORSOptions(cors *config.CORS, methodAllowed methodAllowedFunc) (*CORSOptions, error)
func (*CORSOptions) AllowsOrigin ¶
func (c *CORSOptions) AllowsOrigin(origin string) bool
type CustomLogs ¶
type CustomLogs struct {
// contains filtered or unexported fields
}
func (*CustomLogs) ServeHTTP ¶
func (c *CustomLogs) ServeHTTP(rw http.ResponseWriter, req *http.Request)
func (*CustomLogs) String ¶
func (c *CustomLogs) String() string
type MetricsHandler ¶
type MetricsHandler struct {
// contains filtered or unexported fields
}
func (*MetricsHandler) ServeHTTP ¶
func (mh *MetricsHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
type Next ¶
type Next func(http.Handler) *NextHandler
func NewErrorHandler ¶
func NewMetricsHandler ¶
func NewMetricsHandler() Next
func NewRecordHandler ¶
func NewTraceHandler ¶
type NextHandler ¶
type NextHandler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(handler, next http.Handler) *NextHandler
func (*NextHandler) Child ¶
func (n *NextHandler) Child() http.Handler
func (*NextHandler) ServeHTTP ¶
func (n *NextHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
type TraceHandler ¶
type TraceHandler struct {
// contains filtered or unexported fields
}
func (*TraceHandler) ServeHTTP ¶
func (th *TraceHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
Click to show internal directories.
Click to hide internal directories.