Skip to content

Latest commit

 

History

History
83 lines (65 loc) · 2.7 KB

README.md

File metadata and controls

83 lines (65 loc) · 2.7 KB

Go GCP Secret Manager

Go GCP Secret Manager

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.


codecov License Actions Status Go Report Card Open Source Love

A simple golang package for reading, writing, deleting, storing and editing secrets on Google Cloud Secret Manager.

With extensive test coverage and benchmarks.

Features

  • Lightweight and fast
  • Native Go implementation.
  • Context based client authorization
  • Integrated API wrapper
  • Improved API error handlers
  • Improved CRUD operations on GCP Secrets

Installation

Install the package to your $GOPATH with the go tool from shell:

$ go get github.com/kioie/gcp-secret-manager

Requirements

gcp-secret-manager package tested against Go >= 1.13.x.

Usage

Import the gcp-secret-manager package

import "github.com/kioie/gcp-secret-manager"

Declare global variable ProjectID

ProjectID="<your-project-id>"

Example

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)
}

Contributors

Copyright

Copyright © 2020 Eddy Kioi

Go GCP-SECRET-MANAGER package released under Apache License .