Skip to content

Latest commit

 

History

History
46 lines (31 loc) · 1.29 KB

README.md

File metadata and controls

46 lines (31 loc) · 1.29 KB

Vault

Tests status badge Go Report Card Codebeat report Codecov badge

Vault provides a simple file-based key-value store for secrets.

Installation

go get github.com/redwebcreation/vault

Usage

package main

import (
	"fmt"
	"github.com/redwebcreation/vault"
)

func main() {
	v, _ := vault.NewVault("/path/to/vault")

	_ = v.Set("key", []byte("the-secret"), []byte("super-secret-password"))
	keyContents, _ := v.Get("key", []byte("super-secret-password"))

	fmt.Printf("%s", keyContents) // prints "the-secret"

	_ = v.Delete("key")

	v.Has("key") // returns false
}

Testing

go test -v ./...

vault was created by Félix Dorn under the MIT license