cmd

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoSecretFound is thrown when no secret name was provided but we didn't find any secrets
	ErrNoSecretFound = errors.New("no secrets found")

	// ErrSecretEmpty is thrown when there's no data in the secret
	ErrSecretEmpty = errors.New("secret is empty")

	// ErrSecretKeyNotFound is thrown if the key doesn't exist in the secret
	ErrSecretKeyNotFound = errors.New("provided key not found in secret")
)

Functions

func NewCmdViewSecret

func NewCmdViewSecret() *cobra.Command

NewCmdViewSecret creates the cobra command to be executed

func ProcessSecret added in v0.2.0

func ProcessSecret(outWriter, errWriter io.Writer, inputReader io.Reader, secret Secret, secretKey string, decodeAll bool) error

ProcessSecret takes the secret and user input to determine the output

Types

type CommandOpts

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

CommandOpts is the struct holding common properties

func (*CommandOpts) ParseArgs added in v0.13.0

func (c *CommandOpts) ParseArgs(args []string)

ParseArgs serializes the user supplied program arguments

func (*CommandOpts) Retrieve

func (c *CommandOpts) Retrieve(cmd *cobra.Command) error

Retrieve reads the kubeconfig and decodes the secret

type Metadata added in v0.13.0

type Metadata struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

type Secret added in v0.13.0

type Secret struct {
	Data     SecretData `json:"data"`
	Metadata Metadata   `json:"metadata"`
}

type SecretData added in v0.13.0

type SecretData map[string]string

type SecretList added in v0.13.0

type SecretList struct {
	Items []Secret `json:"items"`
}

Jump to

Keyboard shortcuts

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