client

package
v0.0.0-...-f85bbce Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config Config) (smwaypoint.ClientService, error)

New creates a new Waypoint client given the config. If configured for HCP Waypoint Get Namespace and attach it to the basepath and setup bearer token transport.

Types

type Config

type Config struct {
	//HCPConfig contains config values to interact with HCP Waypoint API
	//This config should be nil if interacting with Self Managed Waypoint API
	*HCPWaypointConfig

	//WaypointConfig contains config values to interact with Self Managed Waypoint API.
	//This config should be set to nil if interacting with HCP Waypoint API.
	*WaypointConfig

	//BasePath is the path to the api server.
	BasePath string

	//ServerURL is the URL of the Waypoint Server. Only for Self-Managed Waypoint.
	ServerUrl string

	//Schemes is the protocol the client will be set to use. Defaults to https
	Schemes []string
}

func NewWithHCP

func NewWithHCP(orgId, projectId, clientId, clientSecret string, ctx context.Context) (*Config, error)

NewWithHCP creates a new HCP Waypoint Configuration with bearer token auth given HCP Waypoint parameters.

func NewWithSelfManaged

func NewWithSelfManaged(waypointUserToken, serverUrl string, skipVerify bool) (*Config, error)

type HCPWaypointConfig

type HCPWaypointConfig struct {
	//HCPOrgId is the organization id. Only for HCP Waypoint.
	HCPOrgId string

	// HCPProjectId is the hcp project id. Only for HCP Waypoint.
	HCPProjectId string

	//clientCredentialsConfig is the service principal credentials that will be used for oauth.
	ClientCredentialsConfig clientcredentials.Config

	//BasePath is the path to the api server.
	BasePath string
	// contains filtered or unexported fields
}

func (*HCPWaypointConfig) Token

func (c *HCPWaypointConfig) Token() (*oauth2.Token, error)

type WaypointConfig

type WaypointConfig struct {

	///WaypointUserToken is the user token used for auth in self-managed Waypoint. Only for Self-Managed Waypoint.
	WaypointUserToken string

	// Waypoint by default runs with a self-signed certificate.
	InsecureSkipVerify bool
}

Jump to

Keyboard shortcuts

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