Documentation ¶
Index ¶
- Constants
- func ClusterInjectionStreamClientInterceptor() grpc.StreamClientInterceptor
- func ClusterInjectionUnaryClientInterceptor() grpc.UnaryClientInterceptor
- func ClusterValidationStreamServerInterceptor() grpc.StreamServerInterceptor
- func ClusterValidationUnaryServerInterceptor() grpc.UnaryServerInterceptor
- func ServerIDInjectionStreamClientInterceptor(targetServerID int64) grpc.StreamClientInterceptor
- func ServerIDInjectionUnaryClientInterceptor(targetServerID int64) grpc.UnaryClientInterceptor
- func ServerIDValidationStreamServerInterceptor(fn GetServerIDFunc) grpc.StreamServerInterceptor
- func ServerIDValidationUnaryServerInterceptor(fn GetServerIDFunc) grpc.UnaryServerInterceptor
- type GetServerIDFunc
Constants ¶
const ClusterKey = "Cluster"
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