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() (*HandshakerResp, 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(*HandshakerReq) 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).
*handshakerServiceDoHandshakeClient
T : google.golang.org/grpc.ClientStream
T : google.golang.org/grpc.Stream
func HandshakerServiceClient.DoHandshake(ctx context.Context, opts ...grpc.CallOption) (HandshakerService_DoHandshakeClient, error)
Context returns the context for this stream.
( T) Recv() (*HandshakerReq, 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(*HandshakerResp) 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.
*handshakerServiceDoHandshakeServer
T : google.golang.org/grpc.ServerStream
T : google.golang.org/grpc.Stream
func HandshakerServiceServer.DoHandshake(HandshakerService_DoHandshakeServer) error
func (*UnimplementedHandshakerServiceServer).DoHandshake(srv HandshakerService_DoHandshakeServer) error
func UnstableHandshakerServiceService.DoHandshake(HandshakerService_DoHandshakeServer) error
HandshakerServiceClient is the client API for HandshakerService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
Handshaker service accepts a stream of handshaker request, returning a
stream of handshaker response. Client is expected to send exactly one
message with either client_start or server_start followed by one or more
messages with next. Each time client sends a request, the handshaker
service expects to respond. Client does not have to wait for service's
response before sending next request.
*handshakerServiceClient
func NewHandshakerServiceClient(cc grpc.ClientConnInterface) HandshakerServiceClient
HandshakerServiceServer is the server API for HandshakerService service.
Handshaker service accepts a stream of handshaker request, returning a
stream of handshaker response. Client is expected to send exactly one
message with either client_start or server_start followed by one or more
messages with next. Each time client sends a request, the handshaker
service expects to respond. Client does not have to wait for service's
response before sending next request.
*UnimplementedHandshakerServiceServerUnstableHandshakerServiceService(interface)
T : UnstableHandshakerServiceService
func RegisterHandshakerServiceServer(s *grpc.Server, srv HandshakerServiceServer)
HandshakerServiceService is the service API for HandshakerService service.
Fields should be assigned to their respective handler implementations only before
RegisterHandshakerServiceService is called. Any unassigned fields will result in the
handler for that method returning an Unimplemented error.
Handshaker service accepts a stream of handshaker request, returning a
stream of handshaker response. Client is expected to send exactly one
message with either client_start or server_start followed by one or more
messages with next. Each time client sends a request, the handshaker
service expects to respond. Client does not have to wait for service's
response before sending next request.
(*T) doHandshake(_ interface{}, stream grpc.ServerStream) error
func NewHandshakerServiceService(s interface{}) *HandshakerServiceService
func RegisterHandshakerServiceService(s grpc.ServiceRegistrar, srv *HandshakerServiceService)
UnstableHandshakerServiceService is the service API for HandshakerService 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.
Handshaker service accepts a stream of handshaker request, returning a
stream of handshaker response. Client is expected to send exactly one
message with either client_start or server_start followed by one or more
messages with next. Each time client sends a request, the handshaker
service expects to respond. Client does not have to wait for service's
response before sending next request.
HandshakerServiceServer(interface)
*UnimplementedHandshakerServiceServer
T : HandshakerServiceServer
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() (*HandshakerResp, 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 *HandshakerReq) 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 : HandshakerService_DoHandshakeClient
T : google.golang.org/grpc.ClientStream
T : google.golang.org/grpc.Stream
ServerStreamgrpc.ServerStream
Context returns the context for this stream.
(*T) Recv() (*HandshakerReq, 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 *HandshakerResp) 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 : HandshakerService_DoHandshakeServer
T : google.golang.org/grpc.ServerStream
T : google.golang.org/grpc.Stream
NewHandshakerServiceService creates a new HandshakerServiceService containing the
implemented methods of the HandshakerService 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.