client

package
v0.0.0-...-a2eab4f Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTokenURL = "https://iam.packetbroker.net/token"

DefaultTokenURL is the default Packet Broker IAM token URL.

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth(username, password string, insecure bool) credentials.PerRPCCredentials

BasicAuth returns per RPC client credentials using basic authentication.

func DialContext

func DialContext(ctx context.Context, logger *zap.Logger, config *Config, defaultPort int) (*grpc.ClientConn, error)

DialContext dials a Packet Broker service using the given configuration.

func OAuth2

func OAuth2(ctx context.Context, tokenURL, clientID, clientSecret, audience string, scopes []string, insecure bool) credentials.PerRPCCredentials

OAuth2 returns per RPC client credentials using the OAuth Client Credentials flow. The token is being refreshed in the background.

Types

type Config

type Config struct {
	Address     string
	DialTimeout time.Duration
	Insecure    bool
	Credentials credentials.PerRPCCredentials
}

Config configures Client.

Jump to

Keyboard shortcuts

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