common

package
v1.8.5 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// AltLeftDelim for go templating
	AltLeftDelim = "<<"
	// AltRightDelim for go templating
	AltRightDelim = ">>"
	// DefaultLeftDelim for go templating
	DefaultLeftDelim = "{{"
	// DefaultRightDelim for go templating
	DefaultRightDelim = "}}"
	// DefaultCacheTTL secrets client default cache TTL
	DefaultCacheTTL = 5 * time.Minute
)

Variables

View Source
var (
	// Logger for global use
	Logger               = log.New()
	GetSecretsInputFile  string
	GetSecretsOutputFile string
	UseAlternateDelims   bool
	EditInPlace          bool
	Values               []string
	ValuesFiles          []string
	ValuesMap            = map[string]interface{}{}
)

Functions

func AddEditInPlaceSupport

func AddEditInPlaceSupport(cmd *cobra.Command, p *bool)

AddEditInPlaceSupport will add the standard edit in place option and store the user input in the provided bool variable.

func AddInputFileSupport

func AddInputFileSupport(cmd *cobra.Command, p *string)

AddInputFileSupport will add the standard dockcmd input file option and store the user input in the provided string variable.

func AddOutputFileSupport

func AddOutputFileSupport(cmd *cobra.Command, p *string)

AddOutputFileSupport will add the standard dockcmd output file option and store the user input in the provided string variable.

func AddSetValuesSupport

func AddSetValuesSupport(cmd *cobra.Command, p *[]string)

AddSetValuesSupport will add the standard values array and store in the provided string array variable.

func AddUseAlternateDelimitersSupport

func AddUseAlternateDelimitersSupport(cmd *cobra.Command, p *bool)

AddUseAlternateDelimitersSupport will add the standard use alternate delimeters option and store the user input in the provided bool variable.

func AddValuesFileSupport

func AddValuesFileSupport(cmd *cobra.Command, p *[]string)

AddValuesFileSupport will add the standard values file array and store in the provided string array variable.

func ExitIfError added in v1.6.0

func ExitIfError(err error)

ExitIfError will generically handle an error by logging its contents and exiting with a return code of 1.

func GetSecrets added in v1.6.0

func GetSecrets(files []string, funcMap template.FuncMap) error

GetSecrets process get-secrets request.

func LogIfError added in v1.6.0

func LogIfError(err error)

func ParseSecretsTemplate

func ParseSecretsTemplate(data []byte, funcMap template.FuncMap) ([]byte, error)

ParseSecretsTemplate uses the provided funcMap to parse secrets.

func ReadFileOrStdin

func ReadFileOrStdin(input string) ([]byte, error)

ReadFileOrStdin will read from stdin if "-" is passed as input string or it will the files contents to a byte array.

func ReadSetValues

func ReadSetValues() error

ReadSetValues will add all of the values passed in with --set and store the values in ValuesMap.

func ReadValuesFiles

func ReadValuesFiles() error

func WriteFileOrStdout

func WriteFileOrStdout(data []byte, output string) error

WriteFileOrStdout will write the provided data to stdout or to the specified file.

Types

type SecretClient added in v1.8.0

type SecretClient interface {
	GetJSONSecret(secretName string, secretKey string) (string, error)
	GetTextSecret(secretName string) (string, error)
}

Jump to

Keyboard shortcuts

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