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).
*loadBalancerBalanceLoadClient
*google.golang.org/grpc/balancer/grpclb.balanceLoadClientStream
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.
*loadBalancerBalanceLoadServer
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.
*loadBalancerClient
func NewLoadBalancerClient(cc grpc.ClientConnInterface) LoadBalancerClient
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.
(*T) balanceLoad(_ interface{}, stream grpc.ServerStream) error
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_NoUnkeyedLiteralstruct{}XXX_sizecacheint32XXX_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
*T : google.golang.org/protobuf/internal/impl.messageV1
*T : context.stringer
*T : runtime.stringer
func (*ServerList).GetServers() []*Server
func google.golang.org/grpc/balancer/grpclb.newLBPicker(serverList []*Server, readySCs []balancer.SubConn, stats *grpclb.rpcStats) *grpclb.lbPicker
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
ClientStreamgrpc.ClientStream
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(m *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 : LoadBalancer_BalanceLoadClient
T : google.golang.org/grpc.ClientStream
T : google.golang.org/grpc.Stream
ServerStreamgrpc.ServerStream
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(m *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 : LoadBalancer_BalanceLoadServer
T : google.golang.org/grpc.ServerStream
T : google.golang.org/grpc.Stream
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.
The pages are generated with Goldsv0.3.2-preview. (GOOS=darwin GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.