MCPcopy Create free account
hub / github.com/google/go-cloud / dialEmulator

Function dialEmulator

pubsub/gcppubsub/gcppubsub.go:310–318  ·  view source on GitHub ↗

dialEmulator opens a gRPC connection to the GCP Pub Sub API.

(ctx context.Context, e string)

Source from the content-addressed store, hash-verified

308
309// dialEmulator opens a gRPC connection to the GCP Pub Sub API.
310func dialEmulator(ctx context.Context, e string) (*grpc.ClientConn, error) {
311 conn, err := grpc.DialContext(ctx, e,
312 grpc.WithTransportCredentials(insecure.NewCredentials()),
313 useragent.GRPCDialOption("pubsub"))
314 if err != nil {
315 return nil, err
316 }
317 return conn, nil
318}
319
320// PublisherClient returns a *raw.PublisherClient that can be used in OpenTopic.
321func PublisherClient(ctx context.Context, conn *grpc.ClientConn) (*raw.PublisherClient, error) {

Callers 1

defaultConnMethod · 0.70

Calls 1

GRPCDialOptionFunction · 0.92

Tested by

no test coverage detected