secrets

package
v0.0.0-...-8f52349 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func BrokerCredentialSecretName

func BrokerCredentialSecretName(brokerName string) string

BrokerCredentialSecretName creates a deterministic secret name from a broker name.

Example
fmt.Println(BrokerCredentialSecretName("my-broker"))
Output:

service-broker-my-broker-creds

Types

type AddLabelsOption

type AddLabelsOption func(*addLabelsConfig)

AddLabelsOption is a single option for configuring a addLabelsConfig

func WithAddLabelsNamespace

func WithAddLabelsNamespace(val string) AddLabelsOption

WithAddLabelsNamespace creates an Option that sets the Kubernetes namespace to use

type AddLabelsOptions

type AddLabelsOptions []AddLabelsOption

AddLabelsOptions is a configuration set defining a addLabelsConfig

func AddLabelsOptionDefaults

func AddLabelsOptionDefaults() AddLabelsOptions

AddLabelsOptionDefaults gets the default values for AddLabels.

func (AddLabelsOptions) Extend

Extend creates a new AddLabelsOptions with the contents of other overriding the values set in this AddLabelsOptions.

func (AddLabelsOptions) Namespace

func (opts AddLabelsOptions) Namespace() string

Namespace returns the last set value for Namespace or the empty value if not set.

type Client

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

Client is an implementation of Interface that works with the Service Catalog.

func (*Client) AddLabels

func (c *Client) AddLabels(name string, newLabels map[string]string, options ...AddLabelsOption) error

AddLabels adds labels to an existing secret.

func (*Client) Create

func (c *Client) Create(name string, options ...CreateOption) error

Create creates a Kubernetes secret with the given name and contents.

func (*Client) Delete

func (c *Client) Delete(name string, options ...DeleteOption) error

Delete removes a Kubernetes secret with the given name.

func (*Client) Get

func (c *Client) Get(name string, options ...GetOption) (*corev1.Secret, error)

Get retrieves a Kubernetes secret by its given name.

func (*Client) List

func (c *Client) List(options ...ListOption) ([]corev1.Secret, error)

List returns a list of secrets optionally filtered by their labels.

type ClientInterface

type ClientInterface interface {
	// Create creates a Kubernetes secret with the given name and contents.
	Create(name string, options ...CreateOption) error

	// Get retrieves a Kubernetes secret by its given name.
	Get(name string, options ...GetOption) (*corev1.Secret, error)

	// Delete removes a Kubernetes secret with the given name.
	Delete(name string, options ...DeleteOption) error

	// AddLabels adds labels to an existing secret.
	AddLabels(name string, labels map[string]string, options ...AddLabelsOption) error

	// List returns a list of secrets optionally filtered by their labels.
	List(options ...ListOption) ([]corev1.Secret, error)
}

ClientInterface is a client capable of interacting with Kubernetes secrets.

func NewClient

func NewClient(kclient kubernetes.Interface) ClientInterface

NewClient creates a new client capable of interacting with Kubernetes secrets.

type CreateOption

type CreateOption func(*createConfig)

CreateOption is a single option for configuring a createConfig

func WithCreateData

func WithCreateData(val map[string][]byte) CreateOption

WithCreateData creates an Option that sets data to store in the secret. Values MUST be base64.

func WithCreateLabels

func WithCreateLabels(val map[string]string) CreateOption

WithCreateLabels creates an Option that sets labels to set on the secret.

func WithCreateNamespace

func WithCreateNamespace(val string) CreateOption

WithCreateNamespace creates an Option that sets the Kubernetes namespace to use

func WithCreateStringData

func WithCreateStringData(val map[string]string) CreateOption

WithCreateStringData creates an Option that sets data to store in the secret. Values are encoded in base64 automatically.

type CreateOptions

type CreateOptions []CreateOption

CreateOptions is a configuration set defining a createConfig

func CreateOptionDefaults

func CreateOptionDefaults() CreateOptions

CreateOptionDefaults gets the default values for Create.

func (CreateOptions) Data

func (opts CreateOptions) Data() map[string][]byte

Data returns the last set value for Data or the empty value if not set.

func (CreateOptions) Extend

func (opts CreateOptions) Extend(other CreateOptions) CreateOptions

Extend creates a new CreateOptions with the contents of other overriding the values set in this CreateOptions.

func (CreateOptions) Labels

func (opts CreateOptions) Labels() map[string]string

Labels returns the last set value for Labels or the empty value if not set.

func (CreateOptions) Namespace

func (opts CreateOptions) Namespace() string

Namespace returns the last set value for Namespace or the empty value if not set.

func (CreateOptions) StringData

func (opts CreateOptions) StringData() map[string]string

StringData returns the last set value for StringData or the empty value if not set.

type DeleteOption

type DeleteOption func(*deleteConfig)

DeleteOption is a single option for configuring a deleteConfig

func WithDeleteNamespace

func WithDeleteNamespace(val string) DeleteOption

WithDeleteNamespace creates an Option that sets the Kubernetes namespace to use

type DeleteOptions

type DeleteOptions []DeleteOption

DeleteOptions is a configuration set defining a deleteConfig

func DeleteOptionDefaults

func DeleteOptionDefaults() DeleteOptions

DeleteOptionDefaults gets the default values for Delete.

func (DeleteOptions) Extend

func (opts DeleteOptions) Extend(other DeleteOptions) DeleteOptions

Extend creates a new DeleteOptions with the contents of other overriding the values set in this DeleteOptions.

func (DeleteOptions) Namespace

func (opts DeleteOptions) Namespace() string

Namespace returns the last set value for Namespace or the empty value if not set.

type GetOption

type GetOption func(*getConfig)

GetOption is a single option for configuring a getConfig

func WithGetNamespace

func WithGetNamespace(val string) GetOption

WithGetNamespace creates an Option that sets the Kubernetes namespace to use

type GetOptions

type GetOptions []GetOption

GetOptions is a configuration set defining a getConfig

func GetOptionDefaults

func GetOptionDefaults() GetOptions

GetOptionDefaults gets the default values for Get.

func (GetOptions) Extend

func (opts GetOptions) Extend(other GetOptions) GetOptions

Extend creates a new GetOptions with the contents of other overriding the values set in this GetOptions.

func (GetOptions) Namespace

func (opts GetOptions) Namespace() string

Namespace returns the last set value for Namespace or the empty value if not set.

type ListOption

type ListOption func(*listConfig)

ListOption is a single option for configuring a listConfig

func WithListLabelSelector

func WithListLabelSelector(val string) ListOption

WithListLabelSelector creates an Option that sets filters results to only labels matching the filter.

func WithListNamespace

func WithListNamespace(val string) ListOption

WithListNamespace creates an Option that sets the Kubernetes namespace to use

type ListOptions

type ListOptions []ListOption

ListOptions is a configuration set defining a listConfig

func ListOptionDefaults

func ListOptionDefaults() ListOptions

ListOptionDefaults gets the default values for List.

func (ListOptions) Extend

func (opts ListOptions) Extend(other ListOptions) ListOptions

Extend creates a new ListOptions with the contents of other overriding the values set in this ListOptions.

func (ListOptions) LabelSelector

func (opts ListOptions) LabelSelector() string

LabelSelector returns the last set value for LabelSelector or the empty value if not set.

func (ListOptions) Namespace

func (opts ListOptions) Namespace() string

Namespace returns the last set value for Namespace or the empty value if not set.

Directories

Path Synopsis
Package fake is a generated GoMock package.
Package fake is a generated GoMock package.

Jump to

Keyboard shortcuts

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