Help us shape the future of Go! Take the 2026 Go Developer Survey

envstore

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package envstore persists plaintext managed environment values. It has no dependency on secret backends or unlock credentials.

Index

Constants

View Source
const FileName = "env.yaml"

Variables

View Source
var (
	ErrNotFound = errors.New("environment variable not found")
)

Functions

func ValidateName

func ValidateName(name string) error

Types

type BatchStore

type BatchStore interface {
	EnvStore
	DeleteValues(contextName string, names []string) error
	RestoreValues(contextName string, values []EnvValue) error
}

BatchStore extends environment CRUD with atomic mutations used when a caller must compensate another store's failed operation. Snapshots stay in memory.

type EnvStore

type EnvStore interface {
	Set(contextName, name, value string) error
	Get(contextName, name string) (string, error)
	Meta(contextName, name string) (EnvValue, error)
	List(contextName string) ([]EnvValue, error)
	Delete(contextName, name string) error
}

func NewStore

func NewStore(dir string) EnvStore

func NewStoreForConfig

func NewStoreForConfig(_ *config.Config) (EnvStore, error)

type EnvValue

type EnvValue struct {
	Name     string    `json:"-"`
	Context  string    `json:"-"`
	Value    string    `json:"value"`
	Created  time.Time `json:"created"`
	LastUsed time.Time `json:"lastUsed,omitzero"`
}

Jump to

Keyboard shortcuts

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