common

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: Apache-2.0 Imports: 12 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 = "}}"
)

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 CommonGetSecrets

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

CommonGetSecrets process get-secrets request.

func HandleError

func HandleError(err error)

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

func ParseSecretsTemplate

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

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

This section is empty.

Jump to

Keyboard shortcuts

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