Documentation ¶
Index ¶
- Variables
- func DataResponse(value interface{}) map[string]interface{}
- func MakeHandler(m *mux.Router, validator *auth.Validator, logger logging.Logger) http.Handler
- func MakeHandlerWithGraphQL(m *mux.Router, schema *graphql.Schema, opt *GraphQLHandlerOptions, ...) http.Handler
- type ErrorMessage
- type ErrorResponse
- type GraphQLHandlerOptions
- type Middleware
- type MiddlewareChain
- type MiddlewareFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var MonitorMiddleware = MiddlewareFunc(func(next http.Handler) http.Handler { return &ochttp.Handler{ Propagation: monitoring.HTTPFormat, Handler: next, } })
View Source
var TokenCtxKey common.ContextKey
Functions ¶
func DataResponse ¶
func DataResponse(value interface{}) map[string]interface{}
func MakeHandler ¶
Types ¶
type ErrorMessage ¶
type ErrorResponse ¶
type ErrorResponse struct {
Error ErrorMessage `json:"error"`
}
type GraphQLHandlerOptions ¶
type Middleware ¶
var ( ProxyMiddleware Middleware = MiddlewareFunc(handlers.ProxyHeaders) LoggingMiddleware Middleware = MiddlewareFunc(func(next http.Handler) http.Handler { return handlers.CombinedLoggingHandler(os.Stdout, next) }) )
var CorsMiddleware Middleware
func NewAuthMiddleware ¶
func NewAuthMiddleware(validator *auth.Validator) Middleware
func NewLoggingMiddleware ¶
func NewLoggingMiddleware(w io.Writer) Middleware
func NewPanicMiddleware ¶
func NewPanicMiddleware(logger logging.Logger) Middleware
type MiddlewareChain ¶
type MiddlewareChain []Middleware
func NewDefaultMiddlewareChain ¶
func NewDefaultMiddlewareChain(logger logging.Logger) MiddlewareChain
type MiddlewareFunc ¶
func (MiddlewareFunc) Middleware ¶
func (mf MiddlewareFunc) Middleware(next http.Handler) http.Handler
Click to show internal directories.
Click to hide internal directories.