vault

package
v1.5.8 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package vault provides a set of functions to interact with the vault.

Copyright © 2023 zcubbs https://github.com/zcubbs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Secret

type Secret struct {
	Key   string
	Value string
}

Secret struct will hold the data for our secret

type SecretVault

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

SecretVault struct will hold our secrets in memory

func InitializeVaultWithRandomKey

func InitializeVaultWithRandomKey(filename string) (*SecretVault, error)

func NewSecretVault

func NewSecretVault() (*SecretVault, error)

NewSecretVault reads data from the file and decrypts it if exists

func (*SecretVault) AddSecret

func (s *SecretVault) AddSecret(key, value string) error

AddSecret is a function to add a secret to our SecretVault

func (*SecretVault) GetSecret

func (s *SecretVault) GetSecret(key string) (string, error)

GetSecret is a function to get a secret from our SecretVault

func (*SecretVault) Save

func (s *SecretVault) Save() error

Jump to

Keyboard shortcuts

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