package grpc_lb_v1

Import Path
	google.golang.org/grpc/balancer/grpclb/grpc_lb_v1 (on go.dev)

Dependency Relation
	imports 9 packages, and imported by one package


Package-Level Type Names (total 26, in which 21 are exported)
/* sort exporteds by: | */
Contains client level statistics that are useful to load balancing. Each count except the timestamp should be reset to zero after reporting the stats. The list of dropped calls. The total number of RPCs that finished. The total number of RPCs that finished and are known to have been received by a server. The total number of RPCs that failed to reach a server except dropped RPCs. The total number of RPCs that started. The timestamp of generating the report. XXX_NoUnkeyedLiteral struct{} XXX_sizecache int32 XXX_unrecognized []byte (*T) Descriptor() ([]byte, []int) (*T) GetCallsFinishedWithDrop() []*ClientStatsPerToken (*T) GetNumCallsFinished() int64 (*T) GetNumCallsFinishedKnownReceived() int64 (*T) GetNumCallsFinishedWithClientFailedToSend() int64 (*T) GetNumCallsStarted() int64 (*T) GetTimestamp() *timestamp.Timestamp (*T) ProtoMessage() (*T) Reset() (*T) String() string (*T) XXX_DiscardUnknown() (*T) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) (*T) XXX_Merge(src proto.Message) (*T) XXX_Size() int (*T) XXX_Unmarshal(b []byte) error *T : google.golang.org/protobuf/runtime/protoiface.MessageV1 *T : expvar.Var *T : fmt.Stringer func (*LoadBalanceRequest).GetClientStats() *ClientStats
Contains the number of calls finished for a particular load balance token. See Server.load_balance_token. The total number of RPCs that finished associated with the token. XXX_NoUnkeyedLiteral struct{} XXX_sizecache int32 XXX_unrecognized []byte (*T) Descriptor() ([]byte, []int) (*T) GetLoadBalanceToken() string (*T) GetNumCalls() int64 (*T) ProtoMessage() (*T) Reset() (*T) String() string (*T) XXX_DiscardUnknown() (*T) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) (*T) XXX_Merge(src proto.Message) (*T) XXX_Size() int (*T) XXX_Unmarshal(b []byte) error *T : google.golang.org/protobuf/runtime/protoiface.MessageV1 *T : expvar.Var *T : fmt.Stringer func (*ClientStats).GetCallsFinishedWithDrop() []*ClientStatsPerToken
XXX_NoUnkeyedLiteral struct{} XXX_sizecache int32 XXX_unrecognized []byte (*T) Descriptor() ([]byte, []int) (*T) ProtoMessage() (*T) Reset() (*T) String() string (*T) XXX_DiscardUnknown() (*T) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) (*T) XXX_Merge(src proto.Message) (*T) XXX_Size() int (*T) XXX_Unmarshal(b []byte) error *T : google.golang.org/protobuf/runtime/protoiface.MessageV1 *T : expvar.Var *T : fmt.Stringer func (*LoadBalanceResponse).GetFallbackResponse() *FallbackResponse
The name of the load balanced service (e.g., service.googleapis.com). Its length should be less than 256 bytes. The name might include a port number. How to handle the port number is up to the balancer. XXX_NoUnkeyedLiteral struct{} XXX_sizecache int32 XXX_unrecognized []byte (*T) Descriptor() ([]byte, []int) (*T) GetName() string (*T) ProtoMessage() (*T) Reset() (*T) String() string (*T) XXX_DiscardUnknown() (*T) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) (*T) XXX_Merge(src proto.Message) (*T) XXX_Size() int (*T) XXX_Unmarshal(b []byte) error *T : google.golang.org/protobuf/runtime/protoiface.MessageV1 *T : expvar.Var *T : fmt.Stringer func (*LoadBalanceRequest).GetInitialRequest() *InitialLoadBalanceRequest
This interval defines how often the client should send the client stats to the load balancer. Stats should only be reported when the duration is positive. XXX_NoUnkeyedLiteral struct{} XXX_sizecache int32 XXX_unrecognized []byte (*T) Descriptor() ([]byte, []int) (*T) GetClientStatsReportInterval() *duration.Duration (*T) ProtoMessage() (*T) Reset() (*T) String() string (*T) XXX_DiscardUnknown() (*T) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) (*T) XXX_Merge(src proto.Message) (*T) XXX_Size() int (*T) XXX_Unmarshal(b []byte) error *T : google.golang.org/protobuf/runtime/protoiface.MessageV1 *T : expvar.Var *T : fmt.Stringer func (*LoadBalanceResponse).GetInitialResponse() *InitialLoadBalanceResponse
CloseSend closes the send direction of the stream. It closes the stream when non-nil error is met. It is also not safe to call CloseSend concurrently with SendMsg. Context returns the context for this stream. It should not be called until after Header or RecvMsg has returned. Once called, subsequent client-side retries are disabled. Header returns the header metadata received from the server if there is any. It blocks if the metadata is not ready to read. ( T) Recv() (*LoadBalanceResponse, error) RecvMsg blocks until it receives a message into m or the stream is done. It returns io.EOF when the stream completes successfully. On any other error, the stream is aborted and the error contains the RPC status. It is safe to have a goroutine calling SendMsg and another goroutine calling RecvMsg on the same stream at the same time, but it is not safe to call RecvMsg on the same stream in different goroutines. ( T) Send(*LoadBalanceRequest) error SendMsg is generally called by generated code. On error, SendMsg aborts the stream. If the error was generated by the client, the status is returned directly; otherwise, io.EOF is returned and the status of the stream may be discovered using RecvMsg. SendMsg blocks until: - There is sufficient flow control to schedule m with the transport, or - The stream is done, or - The stream breaks. SendMsg does not wait until the message is received by the server. An untimely stream closure may result in lost messages. To ensure delivery, users should ensure the RPC completed successfully using RecvMsg. It is safe to have a goroutine calling SendMsg and another goroutine calling RecvMsg on the same stream at the same time, but it is not safe to call SendMsg on the same stream in different goroutines. It is also not safe to call CloseSend concurrently with SendMsg. Trailer returns the trailer metadata from the server, if there is any. It must only be called after stream.CloseAndRecv has returned, or stream.Recv has returned a non-nil error (including io.EOF). T : google.golang.org/grpc.ClientStream T : google.golang.org/grpc.Stream func LoadBalancerClient.BalanceLoad(ctx context.Context, opts ...grpc.CallOption) (LoadBalancer_BalanceLoadClient, error)
Context returns the context for this stream. ( T) Recv() (*LoadBalanceRequest, error) RecvMsg blocks until it receives a message into m or the stream is done. It returns io.EOF when the client has performed a CloseSend. On any non-EOF error, the stream is aborted and the error contains the RPC status. It is safe to have a goroutine calling SendMsg and another goroutine calling RecvMsg on the same stream at the same time, but it is not safe to call RecvMsg on the same stream in different goroutines. ( T) Send(*LoadBalanceResponse) error SendHeader sends the header metadata. The provided md and headers set by SetHeader() will be sent. It fails if called multiple times. SendMsg sends a message. On error, SendMsg aborts the stream and the error is returned directly. SendMsg blocks until: - There is sufficient flow control to schedule m with the transport, or - The stream is done, or - The stream breaks. SendMsg does not wait until the message is received by the client. An untimely stream closure may result in lost messages. It is safe to have a goroutine calling SendMsg and another goroutine calling RecvMsg on the same stream at the same time, but it is not safe to call SendMsg on the same stream in different goroutines. SetHeader sets the header metadata. It may be called multiple times. When call multiple times, all the provided metadata will be merged. All the metadata will be sent out when one of the following happens: - ServerStream.SendHeader() is called; - The first response is sent out; - An RPC status is sent out (error or success). SetTrailer sets the trailer metadata which will be sent with the RPC status. When called more than once, all the provided metadata will be merged. T : google.golang.org/grpc.ServerStream T : google.golang.org/grpc.Stream func LoadBalancerServer.BalanceLoad(LoadBalancer_BalanceLoadServer) error func (*UnimplementedLoadBalancerServer).BalanceLoad(srv LoadBalancer_BalanceLoadServer) error func UnstableLoadBalancerService.BalanceLoad(LoadBalancer_BalanceLoadServer) error
LoadBalancerClient is the client API for LoadBalancer service. For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. Bidirectional rpc to get a list of servers. func NewLoadBalancerClient(cc grpc.ClientConnInterface) LoadBalancerClient
Types that are valid to be assigned to LoadBalanceRequestType: *LoadBalanceRequest_InitialRequest *LoadBalanceRequest_ClientStats XXX_NoUnkeyedLiteral struct{} XXX_sizecache int32 XXX_unrecognized []byte (*T) Descriptor() ([]byte, []int) (*T) GetClientStats() *ClientStats (*T) GetInitialRequest() *InitialLoadBalanceRequest (*T) GetLoadBalanceRequestType() isLoadBalanceRequest_LoadBalanceRequestType (*T) ProtoMessage() (*T) Reset() (*T) String() string (*T) XXX_DiscardUnknown() (*T) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) (*T) XXX_Merge(src proto.Message) XXX_OneofWrappers is for the internal use of the proto package. (*T) XXX_Size() int (*T) XXX_Unmarshal(b []byte) error *T : google.golang.org/protobuf/runtime/protoiface.MessageV1 *T : expvar.Var *T : fmt.Stringer func LoadBalancer_BalanceLoadServer.Recv() (*LoadBalanceRequest, error) func LoadBalancer_BalanceLoadClient.Send(*LoadBalanceRequest) error
ClientStats *ClientStats
InitialRequest *InitialLoadBalanceRequest
Types that are valid to be assigned to LoadBalanceResponseType: *LoadBalanceResponse_InitialResponse *LoadBalanceResponse_ServerList *LoadBalanceResponse_FallbackResponse XXX_NoUnkeyedLiteral struct{} XXX_sizecache int32 XXX_unrecognized []byte (*T) Descriptor() ([]byte, []int) (*T) GetFallbackResponse() *FallbackResponse (*T) GetInitialResponse() *InitialLoadBalanceResponse (*T) GetLoadBalanceResponseType() isLoadBalanceResponse_LoadBalanceResponseType (*T) GetServerList() *ServerList (*T) ProtoMessage() (*T) Reset() (*T) String() string (*T) XXX_DiscardUnknown() (*T) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) (*T) XXX_Merge(src proto.Message) XXX_OneofWrappers is for the internal use of the proto package. (*T) XXX_Size() int (*T) XXX_Unmarshal(b []byte) error *T : google.golang.org/protobuf/runtime/protoiface.MessageV1 *T : expvar.Var *T : fmt.Stringer func LoadBalancer_BalanceLoadClient.Recv() (*LoadBalanceResponse, error) func LoadBalancer_BalanceLoadServer.Send(*LoadBalanceResponse) error
FallbackResponse *FallbackResponse
InitialResponse *InitialLoadBalanceResponse
ServerList *ServerList
LoadBalancerServer is the server API for LoadBalancer service. Bidirectional rpc to get a list of servers. *UnimplementedLoadBalancerServer UnstableLoadBalancerService (interface) T : UnstableLoadBalancerService func RegisterLoadBalancerServer(s *grpc.Server, srv LoadBalancerServer)
LoadBalancerService is the service API for LoadBalancer service. Fields should be assigned to their respective handler implementations only before RegisterLoadBalancerService is called. Any unassigned fields will result in the handler for that method returning an Unimplemented error. Bidirectional rpc to get a list of servers. func NewLoadBalancerService(s interface{}) *LoadBalancerService func RegisterLoadBalancerService(s grpc.ServiceRegistrar, srv *LoadBalancerService)
Contains server information. When the drop field is not true, use the other fields. Indicates whether this particular request should be dropped by the client. If the request is dropped, there will be a corresponding entry in ClientStats.calls_finished_with_drop. A resolved address for the server, serialized in network-byte-order. It may either be an IPv4 or IPv6 address. An opaque but printable token for load reporting. The client must include the token of the picked server into the initial metadata when it starts a call to that server. The token is used by the server to verify the request and to allow the server to report load to the gRPC LB system. The token is also used in client stats for reporting dropped calls. Its length can be variable but must be less than 50 bytes. A resolved port number for the server. XXX_NoUnkeyedLiteral struct{} XXX_sizecache int32 XXX_unrecognized []byte (*T) Descriptor() ([]byte, []int) (*T) GetDrop() bool (*T) GetIpAddress() []byte (*T) GetLoadBalanceToken() string (*T) GetPort() int32 (*T) ProtoMessage() (*T) Reset() (*T) String() string (*T) XXX_DiscardUnknown() (*T) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) (*T) XXX_Merge(src proto.Message) (*T) XXX_Size() int (*T) XXX_Unmarshal(b []byte) error *T : google.golang.org/protobuf/runtime/protoiface.MessageV1 *T : expvar.Var *T : fmt.Stringer func (*ServerList).GetServers() []*Server
Contains a list of servers selected by the load balancer. The list will be updated when server resolutions change or as needed to balance load across more servers. The client should consume the server list in order unless instructed otherwise via the client_config. XXX_NoUnkeyedLiteral struct{} XXX_sizecache int32 XXX_unrecognized []byte (*T) Descriptor() ([]byte, []int) (*T) GetServers() []*Server (*T) ProtoMessage() (*T) Reset() (*T) String() string (*T) XXX_DiscardUnknown() (*T) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) (*T) XXX_Merge(src proto.Message) (*T) XXX_Size() int (*T) XXX_Unmarshal(b []byte) error *T : google.golang.org/protobuf/runtime/protoiface.MessageV1 *T : expvar.Var *T : fmt.Stringer func (*LoadBalanceResponse).GetServerList() *ServerList
UnimplementedLoadBalancerServer can be embedded to have forward compatible implementations. (*T) BalanceLoad(srv LoadBalancer_BalanceLoadServer) error *T : LoadBalancerServer *T : UnstableLoadBalancerService
UnstableLoadBalancerService is the service API for LoadBalancer service. New methods may be added to this interface if they are added to the service definition, which is not a backward-compatible change. For this reason, use of this type is not recommended. Bidirectional rpc to get a list of servers. LoadBalancerServer (interface) *UnimplementedLoadBalancerServer T : LoadBalancerServer
Package-Level Functions (total 7, in which 4 are exported)
NewLoadBalancerService creates a new LoadBalancerService containing the implemented methods of the LoadBalancer service in s. Any unimplemented methods will result in the gRPC server returning an UNIMPLEMENTED status to the client. This includes situations where the method handler is misspelled or has the wrong signature. For this reason, this function should be used with great care and is not recommended to be used by most users.
RegisterLoadBalancerService registers a service implementation with a gRPC server.