hooks

package
v3.26.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package hooks implements a gRPC middleware that executes service and method hooks.

Register a hook for all methods in a service with filter /package.service or a specific method with filter /package.service/method. Registering a hook overwrites existing hooks with the same filter and name.

Hooks are executed in order of registration. Service hooks are executed before service method hooks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hooks added in v3.18.2

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

func (*Hooks) RegisterStreamHook added in v3.18.2

func (h *Hooks) RegisterStreamHook(filter, name string, f StreamHandlerMiddleware)

func (*Hooks) RegisterUnaryHook added in v3.18.2

func (h *Hooks) RegisterUnaryHook(filter, name string, f UnaryHandlerMiddleware)

func (*Hooks) StreamServerInterceptor added in v3.18.2

func (h *Hooks) StreamServerInterceptor() grpc.StreamServerInterceptor

StreamServerInterceptor returns a new stream server interceptor that executes registered hooks.

func (*Hooks) UnaryServerInterceptor added in v3.18.2

func (h *Hooks) UnaryServerInterceptor() grpc.UnaryServerInterceptor

UnaryServerInterceptor returns a new unary server interceptor that executes registered hooks.

func (*Hooks) UnregisterStreamHook added in v3.18.2

func (h *Hooks) UnregisterStreamHook(filter, name string) bool

func (*Hooks) UnregisterUnaryHook added in v3.18.2

func (h *Hooks) UnregisterUnaryHook(filter, name string) bool

type StreamHandlerMiddleware

type StreamHandlerMiddleware func(grpc.StreamHandler) grpc.StreamHandler

StreamHandlerMiddleware wraps grpc.StreamHandler.

type UnaryHandlerMiddleware

type UnaryHandlerMiddleware func(grpc.UnaryHandler) grpc.UnaryHandler

UnaryHandlerMiddleware wraps grpc.UnaryHandler.

Jump to

Keyboard shortcuts

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