Documentation ¶
Overview ¶
+gengo:runtimedoc=false
Package courierhttp GENERATED BY gengo:injectable DON'T EDIT THIS FILE
Index ¶
- func BasePath(basePath string) courier.Operator
- func BasePathRouter(basePath string) courier.Router
- func Group(path string) courier.Operator
- func GroupRouter(path string) courier.Router
- func OperationInfoInjectContext(ctx context.Context, tpe *OperationInfo) context.Context
- func RequestInjectContext(ctx context.Context, tpe *Request) context.Context
- func RouteDescriberInjectContext(ctx context.Context, tpe RouteDescriber) context.Context
- type BasePathDescriber
- type ContentTypeDescriber
- type CookiesDescriber
- type ErrContextCanceled
- type ErrResponseWriter
- type ErrorResponse
- type FileHeader
- type Method
- type MethodConnect
- type MethodDelete
- type MethodDescriber
- type MethodGet
- type MethodHead
- type MethodOptions
- type MethodPatch
- type MethodPost
- type MethodPut
- type MethodTrace
- type NoContent
- type OperationInfo
- type PathDescriber
- type RedirectDescriber
- type Request
- type RequestInfo
- type Response
- type ResponseSetting
- type ResponseSettingFunc
- type ResponseWriter
- type RouteDescriber
- type Server
- type StatusCodeDescriber
- type WithHeader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasePathRouter ¶
func GroupRouter ¶
func OperationInfoInjectContext ¶
func OperationInfoInjectContext(ctx context.Context, tpe *OperationInfo) context.Context
func RequestInjectContext ¶
func RouteDescriberInjectContext ¶
func RouteDescriberInjectContext(ctx context.Context, tpe RouteDescriber) context.Context
Types ¶
type BasePathDescriber ¶
type BasePathDescriber interface {
BasePath() string
}
type ContentTypeDescriber ¶
type ContentTypeDescriber interface {
ContentType() string
}
type CookiesDescriber ¶
type ErrContextCanceled ¶
type ErrContextCanceled struct {
Reason string
}
func (*ErrContextCanceled) Error ¶
func (e *ErrContextCanceled) Error() string
func (*ErrContextCanceled) StatusCode ¶
func (e *ErrContextCanceled) StatusCode() int
type ErrResponseWriter ¶
type ErrResponseWriter interface {
WriteErr(ctx context.Context, rw http.ResponseWriter, req RequestInfo, err error)
}
type ErrorResponse ¶
type ErrorResponse interface { Error() string Unwrap() error StatusCodeDescriber ContentTypeDescriber CookiesDescriber courier.MetadataCarrier }
func WrapError ¶
func WrapError(err error, opts ...ResponseSettingFunc) ErrorResponse
type FileHeader ¶
type FileHeader interface { io.ReadCloser Filename() string Header() http.Header }
type MethodConnect ¶
type MethodConnect struct{}
func (MethodConnect) Method ¶
func (MethodConnect) Method() string
type MethodDelete ¶
type MethodDelete struct{}
func (MethodDelete) Method ¶
func (MethodDelete) Method() string
type MethodDescriber ¶
type MethodDescriber interface {
Method() string
}
type MethodHead ¶
type MethodHead struct{}
func (MethodHead) Method ¶
func (MethodHead) Method() string
type MethodOptions ¶
type MethodOptions struct{}
func (MethodOptions) Method ¶
func (MethodOptions) Method() string
type MethodPatch ¶
type MethodPatch struct{}
func (MethodPatch) Method ¶
func (MethodPatch) Method() string
type MethodPost ¶
type MethodPost struct{}
func (MethodPost) Method ¶
func (MethodPost) Method() string
type MethodTrace ¶
type MethodTrace struct{}
func (MethodTrace) Method ¶
func (MethodTrace) Method() string
type OperationInfo ¶
+gengo:injectable:provider
func OperationInfoFromContext ¶
func OperationInfoFromContext(ctx context.Context) (*OperationInfo, bool)
func (*OperationInfo) InjectContext ¶
func (p *OperationInfo) InjectContext(ctx context.Context) context.Context
func (OperationInfo) UserAgent ¶
func (s OperationInfo) UserAgent() string
type PathDescriber ¶
type PathDescriber interface {
Path() string
}
type RedirectDescriber ¶
type RedirectDescriber interface { StatusCodeDescriber Location() *url.URL }
type RequestInfo ¶
type RequestInfo = httprequest.Request
type Response ¶
type Response[T any] interface { Underlying() T StatusCodeDescriber ContentTypeDescriber CookiesDescriber courier.MetadataCarrier }
func Wrap ¶
func Wrap[T any](v T, opts ...ResponseSettingFunc) Response[T]
type ResponseSetting ¶
type ResponseSettingFunc ¶
type ResponseSettingFunc = func(s ResponseSetting)
func WithContentType ¶
func WithContentType(contentType string) ResponseSettingFunc
func WithCookies ¶
func WithCookies(cookies ...*http.Cookie) ResponseSettingFunc
func WithMetadata ¶
func WithMetadata(key string, values ...string) ResponseSettingFunc
func WithStatusCode ¶
func WithStatusCode(statusCode int) ResponseSettingFunc
type ResponseWriter ¶
type ResponseWriter interface {
WriteResponse(ctx context.Context, rw http.ResponseWriter, req RequestInfo) error
}
type RouteDescriber ¶
type RouteDescriber interface { MethodDescriber PathDescriber }
+gengo:injectable:provider
func RouteDescriberFromContext ¶
func RouteDescriberFromContext(ctx context.Context) (RouteDescriber, bool)
type StatusCodeDescriber ¶
type StatusCodeDescriber interface {
StatusCode() int
}
type WithHeader ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package client GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE
|
Package client GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE |
Package handler GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE
|
Package handler GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE |
httprouter
Package httprouter GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE
|
Package httprouter GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE |
Package openapi GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE
|
Package openapi GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE |
Click to show internal directories.
Click to hide internal directories.