vault

package
v0.0.0-...-68f985e Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Project

type Project struct {
	ID   int64
	Name string
	Path string
}

Project represents a registered project

type Vault

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

Vault represents the encrypted database

func Open

func Open(path string, masterKey string) (*Vault, error)

Open opens or creates the vault at the given path with the given master key

func (*Vault) Close

func (v *Vault) Close() error

Close closes the database connection

func (*Vault) CreateEnvironment

func (v *Vault) CreateEnvironment(projectID int64, name string) (int64, error)

CreateEnvironment creates an environment within a project

func (*Vault) CreateProject

func (v *Vault) CreateProject(name, path string) (int64, error)

CreateProject registers a new project in the vault

func (*Vault) DeleteLocalOverride

func (v *Vault) DeleteLocalOverride(project, env, key string) error

DeleteLocalOverride removes a local override for a variable.

func (*Vault) DeleteProject

func (v *Vault) DeleteProject(projectID int64) error

DeleteProject removes a project and all its environments and variables

func (*Vault) DeleteVariable

func (v *Vault) DeleteVariable(environmentID int64, key string) error

DeleteVariable removes a variable from an environment

func (*Vault) GetEnvironment

func (v *Vault) GetEnvironment(projectID int64, name string) (int64, error)

GetEnvironment looks up an environment by project and name

func (*Vault) GetLocalOverride

func (v *Vault) GetLocalOverride(project, env, key string) (string, bool, error)

GetLocalOverride returns the local override value for a variable, if one exists. Returns empty string and false if no override is set.

func (*Vault) GetLocalOverrides

func (v *Vault) GetLocalOverrides(project, env string) (map[string]string, error)

GetLocalOverrides returns all local overrides for a project/environment as a map.

func (*Vault) GetProjectByName

func (v *Vault) GetProjectByName(name string) (int64, string, error)

GetProjectByName looks up a project by its name

func (*Vault) GetProjectByPath

func (v *Vault) GetProjectByPath(path string) (int64, string, error)

GetProjectByPath looks up a project by its path on disk

func (*Vault) GetVariable

func (v *Vault) GetVariable(environmentID int64, key string) (string, error)

GetVariable returns the value of a single variable

func (*Vault) GetVariables

func (v *Vault) GetVariables(environmentID int64) (map[string]string, error)

GetVariables returns all variables in an environment as a map

func (*Vault) ListEnvironments

func (v *Vault) ListEnvironments(projectID int64) ([]string, error)

ListEnvironments returns the names of all environments in a project

func (*Vault) ListProjects

func (v *Vault) ListProjects() ([]Project, error)

ListProjects returns all registered projects

func (*Vault) SetLocalOverride

func (v *Vault) SetLocalOverride(project, env, key, value string) error

SetLocalOverride saves or updates a local override for a variable. Uses project and environment names directly since in server mode those projects do not exist in the local vault.

func (*Vault) SetVariable

func (v *Vault) SetVariable(environmentID int64, key, value string) error

SetVariable saves or updates a variable in an environment

func (*Vault) VariableExists

func (v *Vault) VariableExists(environmentID int64, key string) (bool, error)

VariableExists checks whether a variable exists in an environment

Jump to

Keyboard shortcuts

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