domain

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigVersion = 1
View Source
const IndexVersion = 1

Variables

This section is empty.

Functions

func ContainsFold

func ContainsFold(s, substr string) bool

func IsValidEnvKey

func IsValidEnvKey(key string) bool

func ParseDotenv

func ParseDotenv(data []byte) (Dotenv, []DotenvIssue)

func RenderDotenv

func RenderDotenv(values map[string]string) []byte

func ValidateIdentifier

func ValidateIdentifier(name, field string) error

Types

type Config

type Config struct {
	Version    int       `json:"version"`
	Name       string    `json:"name"`
	Recipients []string  `json:"recipients"`
	CreatedAt  time.Time `json:"createdAt"`
}

Config holds vault-level settings.

func DefaultConfig

func DefaultConfig(name string, recipients []string, now time.Time) Config

func (Config) Validate

func (c Config) Validate() error

type Dotenv

type Dotenv struct {
	Values map[string]string
	Order  []string
}

type DotenvIssue

type DotenvIssue struct {
	Line     int
	Severity IssueSeverity
	Message  string
}

type EnvIndex

type EnvIndex struct {
	Keys map[string]*KeyMetadata `json:"keys"`
}

type Index

type Index struct {
	Version  int                      `json:"version"`
	Projects map[string]*ProjectIndex `json:"projects"`
}

func NewIndex

func NewIndex() Index

func (Index) ListEnvs

func (idx Index) ListEnvs(project string) []string

func (Index) ListKeys

func (idx Index) ListKeys(project, env string) []KeyInfo

func (Index) ListProjects

func (idx Index) ListProjects() []string

func (*Index) RemoveKey

func (idx *Index) RemoveKey(project, env, key string)

func (*Index) SetKey

func (idx *Index) SetKey(project, env, key string, updated time.Time)

type IssueSeverity

type IssueSeverity string
const (
	IssueError   IssueSeverity = "error"
	IssueWarning IssueSeverity = "warning"
)

type KeyInfo

type KeyInfo struct {
	Name        string
	LastUpdated time.Time
}

type KeyMetadata

type KeyMetadata struct {
	LastUpdated time.Time `json:"lastUpdated"`
}

type ProjectIndex

type ProjectIndex struct {
	Envs map[string]*EnvIndex `json:"envs"`
}

Jump to

Keyboard shortcuts

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