MCPcopy
hub / github.com/connectrpc/connect-go / Client

Struct Client

client.go:34–39  ·  view source on GitHub ↗

Client is a reusable, concurrency-safe client for a single procedure. Depending on the procedure's type, use the CallUnary, CallClientStream, CallServerStream, or CallBidiStream method. By default, clients use the Connect protocol with the binary Protobuf Codec, ask for gzipped responses, and send

Source from the content-addressed store, hash-verified

32// ask for gzipped responses, and send uncompressed requests. To use the gRPC
33// or gRPC-Web protocols, use the [WithGRPC] or [WithGRPCWeb] options.
34type Client[Req, Res any] struct {
35 config *clientConfig
36 callUnary func(context.Context, *Request[Req]) (*Response[Res], error)
37 protocolClient protocolClient
38 err error
39}
40
41// NewClient constructs a new Client.
42func NewClient[Req, Res any](httpClient HTTPClient, url string, options ...ClientOption) *Client[Req, Res] {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected