vault

package
v0.0.0-...-906ccd7 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultPath    string      = "./.vault"
	DefaultFileExt string      = "pmv"
	VaultPerm      os.FileMode = os.FileMode(int(0755))
)
View Source
var (
	ErrVaultNotExist error = errors.New("vault does not exist")
	ErrAuthAccess    error = errors.New("unauthenticated vault access")
	ErrCredNotExist  error = errors.New("credential does not exist in vault")
)

Functions

func CreateVault

func CreateVault(vm *VaultMeta, password *string) error

func GetVaultCount

func GetVaultCount() (int, error)

Types

type Credential

type Credential struct {
	Domain   string
	Username string
	Password string
}

func CreateCredential

func CreateCredential(domain string, username string, password string) Credential

type Vault

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

func OpenVault

func OpenVault(vm *VaultMeta, password *string) (*Vault, error)

func (*Vault) AddCredential

func (v *Vault) AddCredential(name string, credential Credential) error

func (*Vault) Create

func (v *Vault) Create(password *string) error

func (*Vault) Delete

func (v *Vault) Delete() error

func (*Vault) GetAllCredentials

func (v *Vault) GetAllCredentials() (*map[string]Credential, error)

func (*Vault) GetCredential

func (v *Vault) GetCredential(name string) (*Credential, error)

func (*Vault) IsSignedIn

func (v *Vault) IsSignedIn() bool

func (*Vault) Open

func (v *Vault) Open(password *string) error

func (*Vault) RemoveCredential

func (v *Vault) RemoveCredential(name string) error

func (*Vault) Save

func (v *Vault) Save(password *string) error

type VaultMeta

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

func CreateVaultMeta

func CreateVaultMeta(name *string) VaultMeta

func (*VaultMeta) GetPath

func (vm *VaultMeta) GetPath() string

func (*VaultMeta) IsExists

func (vm *VaultMeta) IsExists() bool

Jump to

Keyboard shortcuts

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