Versions in this module Expand all Collapse all v1 v1.20.2 Jan 28, 2022 Changes in this version + func AsRequestOut(ctx context.Context) context.Context + func ContextWithHttpRequest(ctx context.Context, req *http.Request) context.Context + func ContextWithOperationID(ctx context.Context, operationID string) context.Context + func ContextWithOperatorFactory(ctx context.Context, om *courier.OperatorFactory) context.Context + func ContextWithServiceMeta(ctx context.Context, meta ServiceMeta) context.Context + func EnableQueryInBodyForHttpGet(ctx context.Context) context.Context + func HttpRequestFromContext(ctx context.Context) *http.Request + func OperationIDFromContext(ctx context.Context) string + func OperatorFactoryFromContext(ctx context.Context) *courier.OperatorFactory + func OperatorParamsFromStruct(v interface{}) map[string][]string + func ParamsFromMap(m map[string]string) httprouter.Params + func ShouldQueryInBodyForHttpGet(ctx context.Context) bool + func TryCatch(fn func()) (err error) + type BadRequest struct + func (e *BadRequest) AddErr(err error, in string, nameOrIdx ...interface{}) + func (e *BadRequest) EnableErrTalk() + func (e *BadRequest) Err() error + func (e *BadRequest) SetMsg(msg string) + type BasePathDescriber interface + BasePath func() string + type HttpMiddleware func(http.Handler) http.Handler + func MiddlewareChain(mw ...HttpMiddleware) HttpMiddleware + type HttpRouteHandler struct + func NewHttpRouteHandler(serviceMeta *ServiceMeta, httpRoute *HttpRouteMeta, ...) *HttpRouteHandler + func (handler *HttpRouteHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request) + type HttpRouteMeta struct + OperatorFactoryWithRouteMetas []*OperatorFactoryWithRouteMeta + Route *courier.Route + func NewHttpRouteMeta(route *courier.Route) *HttpRouteMeta + func (route *HttpRouteMeta) Key() string + func (route *HttpRouteMeta) Log() + func (route *HttpRouteMeta) Method() string + func (route *HttpRouteMeta) OperatorNames() string + func (route *HttpRouteMeta) Path() string + func (route *HttpRouteMeta) String() string + type HttpTransport struct + CertFile string + KeyFile string + Middlewares []HttpMiddleware + Port int + ServerModifiers []ServerModifier + TransformerMgr transformers.TransformerMgr + ValidatorMgr validator.ValidatorMgr + func NewHttpTransport(serverModifiers ...ServerModifier) *HttpTransport + func (t *HttpTransport) Serve(router *courier.Router) error + func (t *HttpTransport) ServeContext(ctx context.Context, router *courier.Router) error + func (t *HttpTransport) ServeHTTP(w http.ResponseWriter, req *http.Request) + func (t *HttpTransport) SetDefaults() + type MetaOperator struct + func BasePath(basePath string) *MetaOperator + func Group(path string) *MetaOperator + func (g *MetaOperator) BasePath() string + func (g *MetaOperator) Path() string + type MethodDescriber interface + Method func() string + type OperatorFactoryWithRouteMeta struct + func NewOperatorFactoryWithRouteMeta(op courier.Operator, last bool) *OperatorFactoryWithRouteMeta + type PathDescriber interface + Path func() string + type PathnamePattern struct + func NewPathnamePattern(p string) *PathnamePattern + func (pattern *PathnamePattern) Parse(pathname string) (params httprouter.Params, err error) + func (pattern *PathnamePattern) String() string + func (pattern *PathnamePattern) Stringify(params httprouter.Params) string + type PostValidator interface + PostValidate func(badRequest *BadRequest) + type RequestInfo struct + Request *http.Request + func NewRequestInfo(r *http.Request) *RequestInfo + func (info *RequestInfo) Body() io.Reader + func (info *RequestInfo) CookieValues(name string) []string + func (info *RequestInfo) HeaderValues(name string) []string + func (info *RequestInfo) Param(name string) string + func (info *RequestInfo) QueryValues(name string) []string + func (info *RequestInfo) Value(in string, name string) string + func (info *RequestInfo) Values(in string, name string) []string + type RequestParameter struct + In string + Name string + Transformer transformers.Transformer + Validator validator.Validator + func NewRequestParameter(name string, in string) *RequestParameter + type RequestTransformer struct + Parameters map[string]*RequestParameter + Type reflect.Type + func (t *RequestTransformer) DecodeFrom(info *RequestInfo, meta *courier.OperatorFactory, v interface{}) error + func (t *RequestTransformer) NewRequest(method string, rawUrl string, v interface{}) (*http.Request, error) + func (t *RequestTransformer) NewRequestWithContext(ctx context.Context, method string, rawUrl string, v interface{}) (*http.Request, error) + type RequestTransformerMgr struct + func NewRequestTransformerMgr(transformerMgr transformers.TransformerMgr, ...) *RequestTransformerMgr + func (mgr *RequestTransformerMgr) NewRequest(method string, rawUrl string, v interface{}) (*http.Request, error) + func (mgr *RequestTransformerMgr) NewRequestTransformer(ctx context.Context, typ reflect.Type) (*RequestTransformer, error) + func (mgr *RequestTransformerMgr) NewRequestWithContext(ctx context.Context, method string, rawUrl string, v interface{}) (*http.Request, error) + func (mgr *RequestTransformerMgr) SetDefaults() + type ResponseWithError interface + WriteErrer func(err error) + type RouteMeta struct + BasePath string + Deprecated bool + ID string + Method string + Path string + Summary string + type ServerModifier func(server *http.Server) error + type ServiceMeta struct + Name string + Version string + func ServerMetaFromContext(ctx context.Context) ServiceMeta + func (s *ServiceMeta) SetDefaults() + func (s ServiceMeta) String() string