courierhttp

package
v0.0.0-...-1be23ea Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 26, 2024 License: MIT Imports: 13 Imported by: 7

Documentation

Overview

+gengo:runtimedoc=false

Package courierhttp GENERATED BY gengo:injectable DON'T EDIT THIS FILE

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasePath

func BasePath(basePath string) courier.Operator

func BasePathRouter

func BasePathRouter(basePath string) courier.Router

func Group

func Group(path string) courier.Operator

func GroupRouter

func GroupRouter(path string) courier.Router

func OperationInfoInjectContext

func OperationInfoInjectContext(ctx context.Context, tpe *OperationInfo) context.Context

func RequestInjectContext

func RequestInjectContext(ctx context.Context, tpe *Request) context.Context

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 CookiesDescriber interface {
	Cookies() []*http.Cookie
}

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

func WrapError

func WrapError(err error, opts ...ResponseSettingFunc) ErrorResponse

type FileHeader

type FileHeader interface {
	io.ReadCloser
	Filename() string
	Header() http.Header
}

type Method

type Method struct {
}

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 MethodGet

type MethodGet struct{}

func (MethodGet) Method

func (MethodGet) 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 MethodPut

type MethodPut struct{}

func (MethodPut) Method

func (MethodPut) Method() string

type MethodTrace

type MethodTrace struct{}

func (MethodTrace) Method

func (MethodTrace) Method() string

type NoContent

type NoContent struct{}

type OperationInfo

type OperationInfo struct {
	Server

	ID     string
	Method string
	Route  string
}

+gengo:injectable:provider

func OperationInfoFromContext

func OperationInfoFromContext(ctx context.Context) (*OperationInfo, bool)

func (*OperationInfo) Init

func (v *OperationInfo) Init(ctx context.Context) error

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 Request

type Request = http.Request

+gengo:injectable:provider

func RequestFromContext

func RequestFromContext(ctx context.Context) (*Request, bool)

type RequestInfo

type RequestInfo = httprequest.Request

type Response

func Redirect

func Redirect(statusCode int, location *url.URL) Response[any]

func Wrap

func Wrap[T any](v T, opts ...ResponseSettingFunc) Response[T]

type ResponseSetting

type ResponseSetting interface {
	SetStatusCode(statusCode int)
	SetLocation(location *url.URL)
	SetContentType(contentType string)
	SetMetadata(key string, values ...string)
	SetCookies(cookies []*http.Cookie)
}

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 Server

type Server struct {
	Name    string
	Version string
}

func (Server) UserAgent

func (s Server) UserAgent() string

type StatusCodeDescriber

type StatusCodeDescriber interface {
	StatusCode() int
}

type WithHeader

type WithHeader interface {
	Header() http.Header
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL