Versions in this module Expand all Collapse all v1 v1.22.0 Apr 25, 2024 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 IsRequestOut(ctx context.Context) bool + func OperationIDFromContext(ctx context.Context) string + func OperatorFactoryFromContext(ctx context.Context) *courier.OperatorFactory + func ShouldQueryInBodyForHttpGet(ctx context.Context) bool + type BadRequestError interface + AddErr func(err error, nameOrIdx ...interface{}) + EnableErrTalk func() + SetMsg func(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 PostValidator interface + PostValidate func(badRequest BadRequestError) + type RequestTransformer struct + InParameters map[string][]transformers.RequestParameter + Type reflect.Type + func (t *RequestTransformer) DecodeAndValidate(ctx context.Context, info httpx.RequestInfo, v interface{}) error + func (t *RequestTransformer) DecodeFromRequestInfo(ctx context.Context, info httpx.RequestInfo, 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 + WriteError 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 + type WithFromRequestInfo interface + FromRequestInfo func(req *httpx.RequestInfo) error