// whether of not to remove the token post connection
deleteTokenbool
// switch on dry run
dryRunbool
// the resource items to retrieve
resources*vaultResources
// the interval for producing statistics
statsIntervaltime.Duration
}
var(
optionsconfig
)
funcinit(){
options.resources=new(vaultResources)
flag.StringVar(&options.vaultURL,"vault",getEnv("VAULT_ADDR","https://127.0.0.1:8200"),"the url the vault service is running behind (VAULT_ADDR if available)")
flag.StringVar(&options.vaultToken,"token","","the token used to authenticate to teh vault service (VAULT_TOKEN if available)")
flag.StringVar(&options.vaultTokenFile,"tokenfile",getEnv("VAULT_TOKEN_FILE",""),"the full path to file containing the vault token used for authentication (VAULT_TOKEN_FILE if available)")
flag.StringVar(&options.secretsDirectory,"output",getEnv("VAULT_OUTPUT","/etc/secrets"),"the full path to write the protected resources (VAULT_OUTPUT if available)")
flag.BoolVar(&options.deleteToken,"delete-token",false,"once the we have connected to vault, delete the token file from disk")
flag.BoolVar(&options.dryRun,"dry-run",false,"perform a dry run, printing the content to screen")