core

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: MIT Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasePipe

type BasePipe struct {
	// contains filtered or unexported fields
}

func NewPipe

func NewPipe(gOrc Orchestrator) *BasePipe

func (*BasePipe) Add

func (p *BasePipe) Add(mw Middleware) *BasePipe

func (*BasePipe) AddIf

func (p *BasePipe) AddIf(mw Middleware, predicate bool) *BasePipe

func (*BasePipe) AddRange

func (p *BasePipe) AddRange(mws []Middleware) *BasePipe

func (*BasePipe) Run

func (p *BasePipe) Run(handler Handler, opts ...SetRunOpt) (interface{}, error)

func (*BasePipe) SetOrchestrator

func (p *BasePipe) SetOrchestrator(o Orchestrator) *BasePipe

type Context

type Context interface {
	Context() context.Context
	SetContext(context.Context)
	Get(key string) interface{}
	GetString(key string) string
	Set(key string, value interface{})
	SetInput(interface{})
	Input() interface{}
	SetOutput(interface{})
	Output() interface{}
	SetPath(path string)
	Path() string
	Request() *http.Request
	ResponseHeader() http.Header
}

func NewContext

func NewContext() Context

func NewContextWithReq added in v0.4.2

func NewContextWithReq(req *http.Request) Context

type Handler

type Handler func(ctx Context) (interface{}, error)

type HttpFileResponse deprecated

type HttpFileResponse = data.HttpFileResponse

Deprecated: plz use data.HttpFileResponse instead of it

type HttpResponse deprecated

type HttpResponse = data.HttpResponse

Deprecated: plz use data.HttpResponse instead of it

type Middleware

type Middleware interface {
	SetNext(next Middleware)
	Handle(ctx Context) error
}

func NewHandlerMiddleware

func NewHandlerMiddleware(handler Handler) Middleware

type MockMiddleware

type MockMiddleware struct {
	mock.Mock
}

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 RawHttpResponse deprecated

type RawHttpResponse = data.RawResponse

Deprecated: plz use data.RawResponse instead of it

type ResponseWriter deprecated

type ResponseWriter = data.SpecCodeHttpResponse

Deprecated: plz use data.SpecCodeHttpResponse instead of it

type RunOpt

type RunOpt struct {
	InitContext Context
}

type SetRunOpt

type SetRunOpt func(opt *RunOpt)

func WithRunContext added in v0.4.2

func WithRunContext(ctx Context) SetRunOpt

type SpecCodeHttpResponse deprecated

type SpecCodeHttpResponse = data.SpecCodeResponse

Deprecated: plz use data.SpecCodeResponse instead of it

Jump to

Keyboard shortcuts

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