http

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRequestData

func GetRequestData(ctx context.Context) (map[string]interface{}, error)

func RegisterFilter

func RegisterFilter(filterType string, handler RequestHandler)

Types

type ContextKeyRequestData

type ContextKeyRequestData struct {
}

type DispatchFilter

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

func (*DispatchFilter) OnDestroy

func (dis *DispatchFilter) OnDestroy()

func (*DispatchFilter) OnReceive

func (dis *DispatchFilter) OnReceive(ctx context.Context, headers api.HeaderMap, buf buffer.IoBuffer, trailers api.HeaderMap) api.StreamFilterStatus

func (*DispatchFilter) SetReceiveFilterHandler

func (dis *DispatchFilter) SetReceiveFilterHandler(handler api.StreamReceiverFilterHandler)

type Endpoint

type Endpoint interface {
	Handle(ctx context.Context, params ParamsScanner) (jsonObject map[string]interface{}, err error)
}

type ParamsScanner

type ParamsScanner interface {
	//Next get the next param.
	Next() string
	HasNext() bool
}

type PathResolver

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

PathResolver is a util to extract elements in http path.

func NewPathResolver

func NewPathResolver(path string) *PathResolver

func (*PathResolver) HasNext

func (p *PathResolver) HasNext() bool

func (*PathResolver) Next

func (p *PathResolver) Next() string

func (*PathResolver) UnresolvedPath

func (p *PathResolver) UnresolvedPath() string

type RequestHandler

type RequestHandler interface {
	GetEndpoint(name string) (endpoint Endpoint, ok bool)
}

type ServiceFactory

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

func (*ServiceFactory) CreateFilterChain

func (f *ServiceFactory) CreateFilterChain(context context.Context, callbacks api.StreamFilterChainFactoryCallbacks)

Jump to

Keyboard shortcuts

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