Documentation ¶
Overview ¶
+gengo:runtimedoc=false
Index ¶
- func BasePath(basePath string) courier.Operator
- func BasePathRouter(basePath string) courier.Router
- func ContextWithErrResponseWriter(ctx context.Context, errResponseWriter ErrResponseWriter) context.Context
- func ContextWithHttpRequest(ctx context.Context, req *http.Request) context.Context
- func ContextWithOperationInfo(ctx context.Context, info OperationInfo) context.Context
- func ContextWithRouteDescriber(ctx context.Context, r RouteDescriber) context.Context
- func Group(path string) courier.Operator
- func GroupRouter(path string) courier.Router
- func HttpRequestFromContext(ctx context.Context) *http.Request
- func WrapReadCloser(r io.Reader) io.ReadCloser
- 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 OperationInfo
- type PathDescriber
- type RedirectDescriber
- type Request
- type Response
- type ResponseSetting
- type ResponseSettingFunc
- type ResponseWriter
- type RouteDescriber
- type Server
- type StatusCodeDescriber
- type Transformer
- type WithHeader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasePathRouter ¶
func ContextWithErrResponseWriter ¶
func ContextWithErrResponseWriter(ctx context.Context, errResponseWriter ErrResponseWriter) context.Context
func ContextWithHttpRequest ¶
func ContextWithOperationInfo ¶
func ContextWithOperationInfo(ctx context.Context, info OperationInfo) context.Context
func ContextWithRouteDescriber ¶
func ContextWithRouteDescriber(ctx context.Context, r RouteDescriber) context.Context
func GroupRouter ¶
func WrapReadCloser ¶
func WrapReadCloser(r io.Reader) io.ReadCloser
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 (c *ErrContextCanceled) Error() string
func (ErrContextCanceled) StatusCode ¶
func (ErrContextCanceled) StatusCode() int
type ErrResponseWriter ¶
type ErrResponseWriter interface {
WriteErr(ctx context.Context, rw http.ResponseWriter, req Request, statusErr *statuserror.StatusErr)
}
func ErrResponseWriterFromContext ¶
func ErrResponseWriterFromContext(ctx context.Context) ErrResponseWriter
func ErrResponseWriterFunc ¶
func ErrResponseWriterFunc(fn func(ctx context.Context, rw http.ResponseWriter, req Request, statusErr *statuserror.StatusErr)) ErrResponseWriter
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 ¶
func OperationInfoFromContext ¶
func OperationInfoFromContext(ctx context.Context) OperationInfo
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 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 RouteDescriber ¶
type RouteDescriber interface { MethodDescriber PathDescriber }
func RouteDescriberFromContext ¶
func RouteDescriberFromContext(ctx context.Context) RouteDescriber
type StatusCodeDescriber ¶
type StatusCodeDescriber interface {
StatusCode() int
}
type Transformer ¶
type Transformer interface { // Names name or alias of transformer // prefer using some keyword about content-type Names() []string // New transformer instance by type // in this step will to check transformer is valid for type New(context.Context, typesutil.Type) (Transformer, error) // EncodeTo writer EncodeTo(w io.Writer, v any) (mediaType string, err error) // DecodeFrom reader DecodeFrom(r io.Reader, v any, headers ...textproto.MIMEHeader) error }
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.