Documentation
¶
Overview ¶
copied from github.com/vault/command/kv_helpers
Index ¶
- Constants
- Variables
- func AddEditInPlaceSupport(cmd *cobra.Command, p *bool)
- func AddInputFileSupport(cmd *cobra.Command, p *string)
- func AddOutputFileSupport(cmd *cobra.Command, p *string)
- func AddSetValuesSupport(cmd *cobra.Command, p *[]string)
- func AddUseAlternateDelimitersSupport(cmd *cobra.Command, p *bool)
- func AddValuesFileSupport(cmd *cobra.Command, p *[]string)
- func CommonGetSecrets(files []string, funcMap template.FuncMap)
- func Execute(version string)
- func HandleError(err error)
- func ParseSecretsTemplate(data []byte, funcMap template.FuncMap) []byte
- func ReadFileOrStdin(input string) ([]byte, error)
- func ReadSetValues() error
- func ReadValuesFiles() error
- func WriteFileOrStdout(data []byte, output string) error
- type SessionProvider
Constants ¶
const ( // AltLeftDelim for go templating AltLeftDelim = "<<" // AltRightDelim for go templating AltRightDelim = ">>" // DefaultLeftDelim for go templating DefaultLeftDelim = "{{" // DefaultRightDelim for go templating DefaultRightDelim = "}}" )
Variables ¶
var ( // EnableDebug compile flag. EnableDebug = "true" // Logger for global use Logger = log.New() // CfgFile containing dockcmd config CfgFile string )
Functions ¶
func AddEditInPlaceSupport ¶
AddEditInPlaceSupport will add the standard edit in place option and store the user input in the provided bool variable.
func AddInputFileSupport ¶
AddInputFileSupport will add the standard dockcmd input file option and store the user input in the provided string variable.
func AddOutputFileSupport ¶
AddOutputFileSupport will add the standard dockcmd output file option and store the user input in the provided string variable.
func AddSetValuesSupport ¶
AddSetValuesSupport will add the standard values array and store in the provided string array variable.
func AddUseAlternateDelimitersSupport ¶
AddUseAlternateDelimitersSupport will add the standard use alternate delimeters option and store the user input in the provided bool variable.
func AddValuesFileSupport ¶
AddValuesFileSupport will add the standard values file array and store in the provided string array variable.
func CommonGetSecrets ¶
CommonGetSecrets process get-secrets request.
func Execute ¶
func Execute(version string)
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
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 ¶
ParseSecretsTemplate uses the provided funcMap to parse secrets.
func ReadFileOrStdin ¶
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 commonValuesMap.
func ReadValuesFiles ¶
func ReadValuesFiles() error
func WriteFileOrStdout ¶
WriteFileOrStdout will write the provided data to stdout or to the specified file.
Types ¶
type SessionProvider ¶
SessionProvider custom provider to allow for fallback to session configured credentials.
func (*SessionProvider) IsExpired ¶
func (m *SessionProvider) IsExpired() bool
IsExpired for SessionProvider.
func (*SessionProvider) Retrieve ¶
func (m *SessionProvider) Retrieve() (credentials.Value, error)
Retrieve for SessionProvider.