Documentation ¶
Index ¶
Constants ¶
const ( // HandshakerServiceDoHandshakeProcedure is the fully-qualified name of the HandshakerService's // DoHandshake RPC. HandshakerServiceDoHandshakeProcedure = "/grpc.gcp.HandshakerService/DoHandshake" )
These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.
const (
// HandshakerServiceName is the fully-qualified name of the HandshakerService service.
HandshakerServiceName = "grpc.gcp.HandshakerService"
)
Variables ¶
This section is empty.
Functions ¶
func NewHandshakerServiceHandler ¶
func NewHandshakerServiceHandler(svc HandshakerServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewHandshakerServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.
By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.
Types ¶
type HandshakerServiceClient ¶
type HandshakerServiceClient interface { // 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. DoHandshake(context.Context) *connect.BidiStreamForClient[gcp.HandshakerReq, gcp.HandshakerResp] }
HandshakerServiceClient is a client for the grpc.gcp.HandshakerService service.
func NewHandshakerServiceClient ¶
func NewHandshakerServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) HandshakerServiceClient
NewHandshakerServiceClient constructs a client for the grpc.gcp.HandshakerService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.
The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).
type HandshakerServiceHandler ¶
type HandshakerServiceHandler interface { // 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. DoHandshake(context.Context, *connect.BidiStream[gcp.HandshakerReq, gcp.HandshakerResp]) error }
HandshakerServiceHandler is an implementation of the grpc.gcp.HandshakerService service.
type UnimplementedHandshakerServiceHandler ¶
type UnimplementedHandshakerServiceHandler struct{}
UnimplementedHandshakerServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedHandshakerServiceHandler) DoHandshake ¶
func (UnimplementedHandshakerServiceHandler) DoHandshake(context.Context, *connect.BidiStream[gcp.HandshakerReq, gcp.HandshakerResp]) error