clustersecret

package
v0.0.0-...-e7c744b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSecretNotFound = errors.New("secret not found")

ErrSecretNotFound represents an error case when the specified secret doesn't exist

Functions

This section is empty.

Types

type Cluster

type Cluster interface {
	// GetOrganizationID returns the organization ID of the cluster.
	GetOrganizationID() uint

	// GetUID returns the unique ID of the cluster.
	GetUID() string
}

Cluster represents a Kubernetes cluster.

type Clusters

type Clusters interface {
	// GetCluster returns a new cluster based on it's ID.
	GetCluster(ctx context.Context, id uint) (Cluster, error)
}

Clusters provides access to the list of clusters.

type SecretCreateRequest

type SecretCreateRequest struct {
	Name   string
	Type   string
	Values map[string]string
	Tags   []string
}

SecretCreateRequest represents a new secret.

type SecretResponse

type SecretResponse struct {
	Name   string
	Type   string
	Values map[string]string
	Tags   []string
}

type SecretStore

type SecretStore interface {
	// EnsureSecretExists creates a secret for an organization if it cannot be found and returns it's ID.
	EnsureSecretExists(organizationID uint, secret SecretCreateRequest) (string, error)

	// GetSecret gets a secret for an organization, if it doesn't exists it returns an ErrSecretNotFound
	GetSecret(organizationID uint, name string) (SecretResponse, error)
}

SecretStore is a generic secret store.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store manages cluster level secrets.

func NewStore

func NewStore(clusters Clusters, secrets SecretStore) *Store

NewStore returns a new cluster secret store.

func (*Store) EnsureSecretExists

func (s *Store) EnsureSecretExists(ctx context.Context, clusterID uint, secret SecretCreateRequest) (string, error)

EnsureSecretExists creates a secret for a cluster if it cannot be found and returns it's ID.

func (*Store) GetSecret

func (s *Store) GetSecret(ctx context.Context, clusterID uint, name string) (SecretResponse, error)

GetSecret gets a secret for a cluster if exists

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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