config

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnectionFromUCPConfig

func NewConnectionFromUCPConfig(option *UCPOptions, k8sConfig *rest.Config) (sdk.Connection, error)

NewConnectionFromUCPConfig creates a Connection for UCP endpoint. It checks if the connection kind is direct and if so, checks if the endpoint is provided and returns a direct connection, otherwise it returns a Kubernetes connection from the provided config. It returns an error if the endpoint is not provided when the connection kind is direct.

Types

type UCPConnectionKind

type UCPConnectionKind = string
const (
	// UCPConnectionKindDirect describes a direct connection to UCP. See pkg/sdk/NewDirectConnection.
	UCPConnectionKindDirect UCPConnectionKind = "direct"

	// KindKubernetes describes a Kubernetes connection to UCP. See pkg/sdk/NewKubernetesConnectionFromConfig.
	UCPConnectionKindKubernetes UCPConnectionKind = "kubernetes"
)

type UCPDirectConnectionOptions

type UCPDirectConnectionOptions struct {
	// Endpoint is the URL endpoint for the connection.
	Endpoint string `yaml:"endpoint"`
}

UCPDirectConnectionOptions describes the connection options for a direct connection.

type UCPOptions

type UCPOptions struct {
	// Kind describes the kind of connection. Use UCPConnectionKindKubernetes for production and UCPConnectionKindDirect for testing with
	// a standalone UCP process.
	Kind UCPConnectionKind `yaml:"kind"`

	// Direct describes the connection options for a direct connection.
	Direct *UCPDirectConnectionOptions `yaml:"direct,omitempty"`
}

UCPOptions represents the configuration for a UCP connection inside our host configuration file.

Jump to

Keyboard shortcuts

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