Documentation ¶
Overview ¶
Package balancer is a forked version of https://github.com/GoogleCloudPlatform/grpc-gcp-go.
Index ¶
- Constants
- Variables
- func ParseAPIConfig(path string) (*pb.ApiConfig, error)
- type GCPInterceptor
- func (gcpInt *GCPInterceptor) GCPStreamClientInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, ...) (grpc.ClientStream, error)
- func (gcpInt *GCPInterceptor) GCPUnaryClientInterceptor(ctx context.Context, method string, req interface{}, reply interface{}, ...) error
Constants ¶
View Source
const (
// Name is the name of grpc_gcp balancer.
Name = "grpc_gcp"
)
Variables ¶
View Source
var ( // DefaultMinConnections is the default number of gRPC sub-connections the // gRPC balancer should create during SDK initialization. DefaultMinConnections = 5 // MinConnections is the minimum number of gRPC sub-connections the gRPC balancer // should create during SDK initialization. // It is initialized in flags package. MinConnections = DefaultMinConnections )
Functions ¶
Types ¶
type GCPInterceptor ¶
type GCPInterceptor struct {
// contains filtered or unexported fields
}
GCPInterceptor provides functions for intercepting client requests in order to support GCP specific features
func NewGCPInterceptor ¶
func NewGCPInterceptor(config *pb.ApiConfig) *GCPInterceptor
NewGCPInterceptor creates a new GCPInterceptor with a given ApiConfig
func (*GCPInterceptor) GCPStreamClientInterceptor ¶
func (gcpInt *GCPInterceptor) GCPStreamClientInterceptor( ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption, ) (grpc.ClientStream, error)
GCPStreamClientInterceptor intercepts the execution of a client streaming RPC and injects necessary information to be used by the picker.
func (*GCPInterceptor) GCPUnaryClientInterceptor ¶
func (gcpInt *GCPInterceptor) GCPUnaryClientInterceptor( ctx context.Context, method string, req interface{}, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption, ) error
GCPUnaryClientInterceptor intercepts the execution of a unary RPC and injects necessary information to be used by the picker.
Click to show internal directories.
Click to hide internal directories.