endpoint

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: Apache-2.0 Imports: 1 Imported by: 97

Documentation

Index

Constants

View Source
const (
	CtxEventBusKey mwCtxKeyType = iota
	CtxEventQueueKey
)

Keys for components attached to the context for a middleware builder.

Variables

This section is empty.

Functions

func DummyEndpoint

func DummyEndpoint(ctx context.Context, req, resp interface{}) (err error)

DummyEndpoint is a dummy endpoint.

Types

type Endpoint

type Endpoint func(ctx context.Context, req, resp interface{}) (err error)

Endpoint represent one method for calling from remote.

func DummyMiddleware

func DummyMiddleware(next Endpoint) Endpoint

DummyMiddleware is a dummy middleware.

type Middleware

type Middleware func(Endpoint) Endpoint

Middleware deal with input Endpoint and output Endpoint.

func Build

func Build(mws []Middleware) Middleware

Build builds the given middlewares into one middleware.

func Chain

func Chain(mws ...Middleware) Middleware

Chain connect middlewares into one middleware.

type MiddlewareBuilder

type MiddlewareBuilder func(ctx context.Context) Middleware

MiddlewareBuilder builds a middleware with information from a context.

Jump to

Keyboard shortcuts

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