Created
April 11, 2016 21:13
-
-
Save frodopwns/05022429594318cf2e86a413ed2b4b13 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cfg := api.DefaultConfig() | |
cfg.Address = "https://your_vault_addr:8200" | |
client, err := api.NewClient(cfg) | |
if err != nil { | |
fmt.Println(err) | |
} | |
inputs := map[string]string{ | |
"mount": "github", | |
"token": "token", | |
} | |
cliHandler := github.CLIHandler{} | |
cTok, err2 := cliHandler.Auth(client, inputs) | |
if err2 != nil { | |
fmt.Println(err2) | |
} | |
client.SetToken(cTok) | |
l := client.Logical() | |
s, err3 := l.Read("secret/testing") | |
if err3 != nil { | |
fmt.Println(err3) | |
} | |
fmt.Printf("%+v\n", *cfg) | |
fmt.Printf("%+v\n", *client) | |
fmt.Printf("%+v\n", *s)` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment