provider

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type SecretProvider

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

SecretProvider creates client based on the options provided.

func NewSecretProvider

func NewSecretProvider(opts SecretProviderOptions) *SecretProvider

NewSecretProvider creates a new SecretProvider instance with the given options.

func (*SecretProvider) GetClient

func (p *SecretProvider) GetClient(ctx context.Context) (secret.Client, error)

GetClient checks if a secret client has already been created, and if not, creates one using the secretClientFactory map. If the provider is not supported, an error is returned.

func (*SecretProvider) SetClient

func (p *SecretProvider) SetClient(client secret.Client)

SetClient sets the secret client for the SecretProvider. This should be used by tests that need to mock the secret client.

type SecretProviderOptions

type SecretProviderOptions struct {
	// Provider configures the secret provider.
	Provider SecretProviderType `yaml:"provider"`

	// ETCD configures options for the etcd secret store.
	ETCD dataprovider.ETCDOptions `yaml:"etcd,omitempty"`
}

SecretProviderOptions contains provider information of the secret.

type SecretProviderType

type SecretProviderType string

SecretProviderType represents types of secret provider.

const (
	// TypeETCDSecret represents the ETCD secret provider.
	TypeETCDSecret SecretProviderType = "etcd"

	// TypeKubernetesSecret represents the Kubernetes secret provider.
	TypeKubernetesSecret SecretProviderType = "kubernetes"
)

Jump to

Keyboard shortcuts

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