service

package
v0.0.0-...-30ae944 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FaultInjectorListenerEnv = "FAULT_INJECTOR_LISTENER"
)

Variables

This section is empty.

Functions

func RegisterInterceptor

func RegisterInterceptor(service grpc.ServiceDesc)

GenerateInterceptor can be used to register an interceptor for a given grpc service. If a service is not registered the interceptor methods will error out

func StreamClientInterceptor

func StreamClientInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error)

func UnaryClientInterceptor

func UnaryClientInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error

Types

type FaultInjectorInterceptor

type FaultInjectorInterceptor interface {
	UnaryClientInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
	// Only the method is passed to the fault injection inspection
	StreamClientInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error)
	RegisterService(service grpc.ServiceDesc)
}

func NewInterceptor

func NewInterceptor(ctx context.Context, server *grpc.Server) FaultInjectorInterceptor

NewInterceptor can be used to generate a single instance of the interceptor

Jump to

Keyboard shortcuts

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