If you are working on GCP Secret Manager, this package is a useful place to start. It offers simple and easy integrations. Use this package to get started.
A simple golang package for reading, writing, deleting, storing and editing secrets on Google Cloud Secret Manager.
With extensive test coverage and benchmarks.
- Lightweight and fast
- Native Go implementation.
- Context based client authorization
- Integrated API wrapper
- Improved API error handlers
- Improved CRUD operations on GCP Secrets
Install the package to your $GOPATH with the go tool from shell:
$ go get github.com/kioie/gcp-secret-manager
gcp-secret-manager
package tested against Go >= 1.13.x
.
Import the gcp-secret-manager
package
import "github.com/kioie/gcp-secret-manager"
Declare global variable ProjectID
ProjectID="<your-project-id>"
package main
import (
"fmt"
"github.com/kioie/gcp-secret-manager"
)
func main() {
//Declare ProjectID
ProjectID = "secret-manager-test"
//Check if "my-secret" exists
fmt.Println(gcp_secret_manager.SecretExists("my-secret"))
//Get the secret
result, _ := gcp_secret_manager.GetSecret("my-secret", "")
fmt.Println(result)
}
Copyright © 2020 Eddy Kioi
Go GCP-SECRET-MANAGER package released under Apache License .