Documentation ¶
Index ¶
- Constants
- Variables
- func AddCommand(app *kingpin.Application, input AddCommandInput)
- func ConfigureAddCommand(app *kingpin.Application)
- func ConfigureExecCommand(app *kingpin.Application)
- func ConfigureGlobals(app *kingpin.Application)
- func ConfigureListCommand(app *kingpin.Application)
- func ConfigureLoginCommand(app *kingpin.Application)
- func ConfigureRemoveCommand(app *kingpin.Application)
- func ConfigureRotateCommand(app *kingpin.Application)
- func ConfigureServerCommand(app *kingpin.Application)
- func ExecCommand(app *kingpin.Application, input ExecCommandInput)
- func LoginCommand(app *kingpin.Application, input LoginCommandInput)
- func LsCommand(app *kingpin.Application, input LsCommandInput)
- func RemoveCommand(app *kingpin.Application, input RemoveCommandInput)
- func RotateCommand(app *kingpin.Application, input RotateCommandInput)
- func ServerCommand(app *kingpin.Application, input ServerCommandInput)
- type AddCommandInput
- type ExecCommandInput
- type LoginCommandInput
- type LsCommandInput
- type RemoveCommandInput
- type RotateCommandInput
- type ServerCommandInput
Examples ¶
Constants ¶
View Source
const (
KeyringName = "aws-vault"
)
Variables ¶
View Source
var GlobalFlags struct { Debug bool Backend string PromptDriver string }
Functions ¶
func AddCommand ¶
func AddCommand(app *kingpin.Application, input AddCommandInput)
Example ¶
f, err := ioutil.TempFile("", "aws-config") if err != nil { log.Fatal(err) } defer os.Remove(f.Name()) os.Setenv("AWS_CONFIG_FILE", f.Name()) os.Setenv("AWS_ACCESS_KEY_ID", "llamas") os.Setenv("AWS_SECRET_ACCESS_KEY", "rock") os.Setenv("AWS_VAULT_BACKEND", "file") os.Setenv("AWS_VAULT_FILE_PASSPHRASE", "password") defer os.Unsetenv("AWS_ACCESS_KEY_ID") defer os.Unsetenv("AWS_SECRET_ACCESS_KEY") defer os.Unsetenv("AWS_VAULT_BACKEND") defer os.Unsetenv("AWS_VAULT_FILE_PASSPHRASE") app := kingpin.New(`aws-vault`, ``) ConfigureGlobals(app) ConfigureAddCommand(app) kingpin.MustParse(app.Parse([]string{"add", "--env", "foo"}))
Output: Added credentials to profile "foo" in vault
func ConfigureAddCommand ¶
func ConfigureAddCommand(app *kingpin.Application)
func ConfigureExecCommand ¶
func ConfigureExecCommand(app *kingpin.Application)
func ConfigureGlobals ¶
func ConfigureGlobals(app *kingpin.Application)
func ConfigureListCommand ¶
func ConfigureListCommand(app *kingpin.Application)
func ConfigureLoginCommand ¶
func ConfigureLoginCommand(app *kingpin.Application)
func ConfigureRemoveCommand ¶
func ConfigureRemoveCommand(app *kingpin.Application)
func ConfigureRotateCommand ¶
func ConfigureRotateCommand(app *kingpin.Application)
func ConfigureServerCommand ¶
func ConfigureServerCommand(app *kingpin.Application)
func ExecCommand ¶
func ExecCommand(app *kingpin.Application, input ExecCommandInput)
Example ¶
awsConfig = &vault.Config{} keyringImpl = keyring.NewArrayKeyring([]keyring.Item{ {Key: "llamas", Data: []byte(`{"AccessKeyID":"ABC","SecretAccessKey":"XYZ"}`)}, }) app := kingpin.New("aws-vault", "") ConfigureGlobals(app) ConfigureExecCommand(app) kingpin.MustParse(app.Parse([]string{ "--debug", "exec", "--no-session", "llamas", "--", "sh", "-c", "echo $AWS_ACCESS_KEY_ID", }))
Output: ABC
func LoginCommand ¶
func LoginCommand(app *kingpin.Application, input LoginCommandInput)
func LsCommand ¶
func LsCommand(app *kingpin.Application, input LsCommandInput)
func RemoveCommand ¶
func RemoveCommand(app *kingpin.Application, input RemoveCommandInput)
func RotateCommand ¶
func RotateCommand(app *kingpin.Application, input RotateCommandInput)
func ServerCommand ¶
func ServerCommand(app *kingpin.Application, input ServerCommandInput)
Types ¶
type AddCommandInput ¶
type ExecCommandInput ¶
type LoginCommandInput ¶
type LsCommandInput ¶
type RemoveCommandInput ¶
type RotateCommandInput ¶
type ServerCommandInput ¶
type ServerCommandInput struct { }
Click to show internal directories.
Click to hide internal directories.