Documentation ¶
Index ¶
- Variables
- func NewContext() *emptyContext
- type BasePipe
- func (p *BasePipe) Add(mw Middleware) *BasePipe
- func (p *BasePipe) AddIf(mw Middleware, predicate bool) *BasePipe
- func (p *BasePipe) AddRange(mws []Middleware) *BasePipe
- func (p *BasePipe) Run(handler Handler, opts ...SetRunOpt) (interface{}, error)
- func (p *BasePipe) SetOrchestrator(o Orchestrator) *BasePipe
- type Context
- type GlobalOpt
- type Handler
- type HttpFileResponse
- type HttpResponse
- type Middleware
- type MockMiddleware
- type Orchestrator
- type RunOpt
- type SetRunOpt
- type SpecCodeHttpResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Option = GlobalOpt{ HeaderKeyRequestID: "X-Request-ID", ResponseNewFunc: func() HttpResponse { return &data.Response{} }, Codec: []codec.Interface{ &codec.Json{}, &codec.MultipartForm{}, &codec.Empty{}, }, } )
Functions ¶
func NewContext ¶
func NewContext() *emptyContext
Types ¶
type BasePipe ¶
type BasePipe struct {
// contains filtered or unexported fields
}
func (*BasePipe) Add ¶
func (p *BasePipe) Add(mw Middleware) *BasePipe
func (*BasePipe) AddRange ¶
func (p *BasePipe) AddRange(mws []Middleware) *BasePipe
func (*BasePipe) SetOrchestrator ¶
func (p *BasePipe) SetOrchestrator(o Orchestrator) *BasePipe
type GlobalOpt ¶
type GlobalOpt struct { HeaderKeyRequestID string ResponseNewFunc func() HttpResponse Orchestrator Orchestrator Codec []codec.Interface }
type HttpFileResponse ¶
type HttpResponse ¶
type Middleware ¶
type Middleware interface { SetNext(next Middleware) Handle(ctx Context) error }
func NewHandlerMiddleware ¶
func NewHandlerMiddleware(handler Handler) Middleware
type MockMiddleware ¶
MockMiddleware is an autogenerated mock type for the Middleware type
func (*MockMiddleware) Handle ¶
func (_m *MockMiddleware) Handle(ctx Context) error
Handle provides a mock function with given fields: ctx
func (*MockMiddleware) Priority ¶
func (_m *MockMiddleware) Priority() int
Priority provides a mock function with given fields:
func (*MockMiddleware) SetNext ¶
func (_m *MockMiddleware) SetNext(next Middleware)
SetNext provides a mock function with given fields: next
type Orchestrator ¶
type Orchestrator func(mws []Middleware) []Middleware
type SpecCodeHttpResponse ¶
type SpecCodeHttpResponse interface { GetStatusCode() int HttpResponse }
Click to show internal directories.
Click to hide internal directories.