Skip to content

Instantly share code, notes, and snippets.

@calavera
Created June 29, 2016 05:25
Show Gist options
  • Save calavera/59d47c359c77b6a8f766cab58e1072ba to your computer and use it in GitHub Desktop.
Save calavera/59d47c359c77b6a8f766cab58e1072ba to your computer and use it in GitHub Desktop.
package main
import (
"github.com/docker/docker-credential-helpers/credentials"
"github.com/docker/docker-credential-helpers/secretservice"
)
var nativeStore = secretservice.SecretService{}
func main() {
c := &credentials.Credentials{
ServerURL: "https://api.github.com",
Username: "token",
Secret: "my-super-secret-token",
}
nativeStore.Add(c)
secret, username, err := nativeStore.Get("https://api.github.com")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment