Documentation
¶
Overview ¶
Package secrets provides secure storage for environment variables and secrets. This file is stored separately from config.json and should be gitignored.
Index ¶
- func DefaultSecretsPath() (string, error)
- type Store
- func (s *Store) AddEnvironment(name string, vars map[string]string) error
- func (s *Store) GetEnvironment(envName string) map[string]string
- func (s *Store) GetVariable(env, name string) (string, bool)
- func (s *Store) GetVariables(env string) (map[string]string, bool)
- func (s *Store) HasEnvironment(name string) bool
- func (s *Store) ListEnvironments() []string
- func (s *Store) Path() string
- func (s *Store) RemoveEnvironment(name string) error
- func (s *Store) Save() error
- func (s *Store) SetVariable(env, name, value string) error
- func (s *Store) UnsetVariable(env, name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultSecretsPath ¶
DefaultSecretsPath returns the path to the default secrets file
Types ¶
type Store ¶
type Store struct {
// EnvironmentVariables maps environment names to their variables
EnvironmentVariables map[string]map[string]string `json:"environmentVariables"`
// contains filtered or unexported fields
}
Store manages environment variables in a separate secrets file
func LoadFromDir ¶
LoadFromDir loads secrets from a specific directory
func LoadFromFile ¶
LoadFromFile loads secrets from a specific file path
func (*Store) AddEnvironment ¶
AddEnvironment adds a new environment
func (*Store) GetEnvironment ¶
GetEnvironment returns the combined environment variables for the given environment name. It merges $shared variables with the specified environment, with environment values taking precedence.
func (*Store) GetVariable ¶
GetVariable gets a variable from a specific environment
func (*Store) GetVariables ¶
GetVariables returns all variables for a specific environment
func (*Store) HasEnvironment ¶
HasEnvironment checks if an environment exists
func (*Store) ListEnvironments ¶
ListEnvironments returns a list of available environment names (excluding $shared)
func (*Store) RemoveEnvironment ¶
RemoveEnvironment removes an environment
func (*Store) SetVariable ¶
SetVariable sets a variable in an environment
func (*Store) UnsetVariable ¶
UnsetVariable removes a variable from an environment