google

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {

	// Include common client methods as well.
	gangwayClient.Common
	// contains filtered or unexported fields
}

func New

func New(addr string, keyBytes []byte, audience, clientPem, apiKey string) (*Client, error)

New creates a new gRPC client. It does most of the work in NewFromFile().

func NewFromFile

func NewFromFile(addr, keyFile, audience, clientPem, apiKey string) (*Client, error)

NewFromFile creates a Gangway client from a JSON service account key file and an audience string.

func (*Client) Close

func (c *Client) Close()

func (*Client) EmbedCredentials

func (c *Client) EmbedCredentials(ctx context.Context) (context.Context, error)

EmbedCredentials is used to modify a provided context so that it has the the necessary token and apiKey attached to it in the metadata.

func (*Client) MkToken

func (c *Client) MkToken() (string, error)

MkToken generates a new JWT token with a 1h TTL. This is apparently a cheap operation, according to https://github.com/GoogleCloudPlatform/golang-samples/blob/e7a5459d85661a35c5eb4f0b5759b7b30ac6ff90/endpoints/getting-started-grpc/client/main.go#L81-L88.

type ClientInsecure

type ClientInsecure struct {

	// Include common client methods as well.
	gangwayClient.Common
	// contains filtered or unexported fields
}

func NewInsecure

func NewInsecure(addr, projectNumber string) (*ClientInsecure, error)

func (*ClientInsecure) Close

func (c *ClientInsecure) Close()

func (*ClientInsecure) EmbedProjectNumber

func (c *ClientInsecure) EmbedProjectNumber(ctx context.Context) context.Context

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL