filter

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, fn FilterFunc)

Register can register a filter func to the framework

func ToInterceptors

func ToInterceptors() []grpc.UnaryServerInterceptor

ToInterceptors will convert FilterFuncs to grpc.UnaryServerInterceptors.

Types

type FilterFunc

type FilterFunc func(ctx context.Context, req any, handle HandlerFunc) (any, error)

FilterFunc defines a new func type that represented the filter function

type HandlerFunc added in v0.0.4

type HandlerFunc grpc.UnaryHandler

HandlerFunc defines the handler of a function

type ServerFilter

type ServerFilter struct {
	Name string
	Fn   FilterFunc
}

ServerFilter is an interceptor for a service as server role

Jump to

Keyboard shortcuts

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