endpoint

package
v0.9.2-rc2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 2 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.

type RecvEndpoint added in v0.9.0

type RecvEndpoint func(stream streaming.Stream, message interface{}) (err error)

RecvEndpoint represent one Recv call

type RecvMiddleware added in v0.9.0

type RecvMiddleware func(next RecvEndpoint) RecvEndpoint

RecvMiddleware deal with input Endpoint and output Endpoint.

func RecvChain added in v0.9.0

func RecvChain(mws ...RecvMiddleware) RecvMiddleware

RecvChain connect middlewares into one middleware.

type RecvMiddlewareBuilder added in v0.9.0

type RecvMiddlewareBuilder func(ctx context.Context) RecvMiddleware

RecvMiddlewareBuilder builds a middleware with information from a context.

type SendEndpoint added in v0.9.0

type SendEndpoint func(stream streaming.Stream, message interface{}) (err error)

SendEndpoint represent one Send call

type SendMiddleware added in v0.9.0

type SendMiddleware func(next SendEndpoint) SendEndpoint

SendMiddleware deal with input Endpoint and output Endpoint.

func SendChain added in v0.9.0

func SendChain(mws ...SendMiddleware) SendMiddleware

SendChain connect middlewares into one middleware.

type SendMiddlewareBuilder added in v0.9.0

type SendMiddlewareBuilder func(ctx context.Context) SendMiddleware

SendMiddlewareBuilder 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