types

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: Apache-2.0 Imports: 6 Imported by: 6

Documentation

Index

Constants

View Source
const (
	CategoriesKey = "categories"
)

Pre-defined environment keys. Environment settings can be added w/o being defined in this section.

Variables

View Source
var (
	// ErrorClientNotFound is returned when the client is not found in the cache
	ErrorClientNotFound = errors.New("client not found in client cache")
	// ErrorPrismAddressNotSet is returned when the address is not set for Nutanix Prism Central
	ErrorPrismAddressNotSet = errors.New("address not set for Nutanix Prism Central")
	// ErrorPrismPortNotSet is returned when the port is not set for Nutanix Prism Central
	ErrorPrismPortNotSet = errors.New("port not set for Nutanix Prism Central")
	// ErrorPrismUsernameNotSet is returned when the username is not set for Nutanix Prism Central
	ErrorPrismUsernameNotSet = errors.New("username not set for Nutanix Prism Central")
	// ErrorPrismPasswordNotSet is returned when the password is not set for Nutanix Prism Central
	ErrorPrismPasswordNotSet = errors.New("password not set for Nutanix Prism Central")
)
View Source
var (
	// ErrNotFound is returned by Get() for missing keys
	ErrNotFound = fmt.Errorf("environment key not found")
)

Functions

This section is empty.

Types

type ApiCredentials

type ApiCredentials struct {
	// Username for basic authentication
	Username string `json:"username,omitempty"`
	// Password for basic authentication
	Password string `json:"password,omitempty"`
	// KeyPair is JSON-encoded key pair for TLS client authentication
	KeyPair string `json:"keyPair,omitempty"`
}

ApiCredentials is set of identifiers and secrets used to authenticate with the underlying infrastructure.

type CacheOpts added in v0.6.0

type CacheOpts[T any] func(*T)

type CachedClientParams added in v0.6.0

type CachedClientParams interface {
	// ManagementEndpoint returns the struct containing all information needed to construct a new client
	// and is used to calculate the validation hash for the client for the purpose of cache invalidation.
	// The validation hash is calculated based on the serialized version of the ManagementEndpoint.
	ManagementEndpoint() ManagementEndpoint
	// Key returns a unique key for the client that is used to store the client in the cache
	Key() string
}

CachedClientParams define the interface that needs to be implemented by an object that will be used to create a cached client.

type ClientOption added in v0.6.0

type ClientOption[T any] func(*T) error

type Environment

type Environment interface {
	// GetManagementEndpoint retrieves management endpoint
	GetManagementEndpoint(topology Topology) (*ManagementEndpoint, error)
	// Get retrieves settings applicable to the environment like project
	// or category to which resources created on behalf of Kubernetes cluster are
	// assigned to.
	// These settings might have to be explicitly propagated to resources.
	// Return whether lookup was successful to distinguish from nil as value.
	Get(topology Topology, key string) (interface{}, error)
}

Environment in which a Kubernetes has been deployed.

type ManagementEndpoint

type ManagementEndpoint struct {
	// ApiCredentials embedded into endpoint
	ApiCredentials
	// Address is URL of management endpoint
	Address *url.URL `json:"address,omitempty"`
	// Whether to authenticate TLS endpoint in case of HTTPS as transport.
	// HTTPS is used for encryption independent of this setting. An
	// unauthenticated TLS endpoint is prone to man-in-the-middle attacks.
	Insecure bool `json:"insecure,omitempty"`
	// AdditionalTrustBundle is a PEM-encoded certificate bundle to be used
	// in addition to system trust store
	AdditionalTrustBundle string `json:"additionalTrustBundle,omitempty"`
}

ManagementEndpoint specifies API endpoint used for interacting with underlying infrastructure.

func (ManagementEndpoint) GetHash added in v0.6.0

func (ep ManagementEndpoint) GetHash() (string, error)

type Provider

type Provider interface {
	Environment
}

Provider of an environment

type Topology

type Topology map[string]string

Topology is a map of topological domains to topological segments. A topological domain is a sub-division of a cluster, like "region", "zone", "rack", etc

Jump to

Keyboard shortcuts

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