handler

package
v0.0.0-...-d5b0b98 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler is the handler that handles unary operations

func New

func New(methodHandler map[string]UnaryHandler, interceptors ...Interceptor) (*Handler, error)

New creates a new handler

func (*Handler) Handler

func (s *Handler) Handler(ctx context.Context, req interface{}, info *UnaryServerInfo) (interface{}, error)

Handler is used to handler events

type Interceptor

type Interceptor = func(ctx context.Context, req interface{},
	info *UnaryServerInfo, handler UnaryHandler) (interface{}, error)

Interceptor is the interceptor that handles any incoming request

func MultiInterceptors

func MultiInterceptors(interceptors ...Interceptor) Interceptor

MultiInterceptors is used to handle multiple interceptors

type UnaryHandler

type UnaryHandler = func(ctx context.Context, req interface{}) (interface{}, error)

UnaryHandler is the handler that handles unary operations

type UnaryServerInfo

type UnaryServerInfo struct {
	// FullMethod is the method name
	FullMethod string
}

UnaryServerInfo is the server info

Jump to

Keyboard shortcuts

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