secret

package
v0.0.0-...-789b534 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2020 License: MIT Imports: 6 Imported by: 0

README

secret

With secret tool, one can encrypt secret message using a key. Same key is needed when reading that message. This message is usually a string. secret saves its data in home directory named .secret.

Usage

$ go run cmd/cli.go
Secret is an API key and other secrets manager

Usage:
  secret [command]

Available Commands:
  get         Gets a secret from your secret storage
  help        Help about any command
  set         Sets a secret in your secret storage

Flags:
  -h, --help         help for secret
  -k, --key string   the key to use when encoding and decoding secrets

If no key is set, the file key is not encrypted and can be called by calling get <key>

# to encrypt a value/message
go run cmd/cli.go --key "secret string" set message 'some secret message'

# to get saved value
go run cmd/cli.go --key "secret string" get message 

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Vault

type Vault struct {
	// contains filtered or unexported fields
}

Vault represent an entity which stores key value pair.

func File

func File(encodingKey, filepath string) *Vault

File takes in an encodingKey and filepath. This encryption key is then used in subsequent calls via Set and Get methods.

func (*Vault) Get

func (v *Vault) Get(key string) (string, error)

Get is a threadsafe method to Vault to get a key from the Vault

func (*Vault) Set

func (v *Vault) Set(key, value string) error

Set is a threadsafe method to Vault to set a key to the value in the Vault

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL