interceptor

package
v0.0.0-...-572c485 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ClusterKey = "Cluster"
View Source
const ServerIDKey = "ServerID"

Variables

This section is empty.

Functions

func ClusterInjectionStreamClientInterceptor

func ClusterInjectionStreamClientInterceptor() grpc.StreamClientInterceptor

ClusterInjectionStreamClientInterceptor returns a new streaming client interceptor that injects `cluster` into outgoing context.

func ClusterInjectionUnaryClientInterceptor

func ClusterInjectionUnaryClientInterceptor() grpc.UnaryClientInterceptor

ClusterInjectionUnaryClientInterceptor returns a new unary client interceptor that injects `cluster` into outgoing context.

func ClusterValidationStreamServerInterceptor

func ClusterValidationStreamServerInterceptor() grpc.StreamServerInterceptor

ClusterValidationStreamServerInterceptor returns a new streaming server interceptor that rejects the request if the client's cluster differs from that of the server. It is chiefly employed to tackle the `Cross-Cluster Routing` issue.

func ClusterValidationUnaryServerInterceptor

func ClusterValidationUnaryServerInterceptor() grpc.UnaryServerInterceptor

ClusterValidationUnaryServerInterceptor returns a new unary server interceptor that rejects the request if the client's cluster differs from that of the server. It is chiefly employed to tackle the `Cross-Cluster Routing` issue.

func ServerIDInjectionStreamClientInterceptor

func ServerIDInjectionStreamClientInterceptor(targetServerID int64) grpc.StreamClientInterceptor

ServerIDInjectionStreamClientInterceptor returns a new streaming client interceptor that injects target server ID into the request.

func ServerIDInjectionUnaryClientInterceptor

func ServerIDInjectionUnaryClientInterceptor(targetServerID int64) grpc.UnaryClientInterceptor

ServerIDInjectionUnaryClientInterceptor returns a new unary client interceptor that injects target server ID into the request.

func ServerIDValidationStreamServerInterceptor

func ServerIDValidationStreamServerInterceptor(fn GetServerIDFunc) grpc.StreamServerInterceptor

ServerIDValidationStreamServerInterceptor returns a new streaming server interceptor that verifies whether the target server ID of request matches with the server's ID and rejects it accordingly.

func ServerIDValidationUnaryServerInterceptor

func ServerIDValidationUnaryServerInterceptor(fn GetServerIDFunc) grpc.UnaryServerInterceptor

ServerIDValidationUnaryServerInterceptor returns a new unary server interceptor that verifies whether the target server ID of request matches with the server's ID and rejects it accordingly.

Types

type GetServerIDFunc

type GetServerIDFunc func() int64

Jump to

Keyboard shortcuts

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