services

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrVaultNotFound = errors.New("vault config not found")

Functions

func FindVaultRoot

func FindVaultRoot(start string, fs ports.FileSystem) (string, error)

Types

type CheckResult

type CheckResult struct {
	Name    string
	Status  CheckStatus
	Message string
}

type CheckStatus

type CheckStatus string
const (
	CheckOK   CheckStatus = "ok"
	CheckWarn CheckStatus = "warn"
	CheckFail CheckStatus = "fail"
)

type ConflictResolver

type ConflictResolver func(key, vaultValue, fileValue string) (string, error)

type DoctorReport

type DoctorReport struct {
	Checks []CheckResult
}

func (DoctorReport) HasFailures

func (r DoctorReport) HasFailures() bool

type DoctorService

type DoctorService struct {
	Store     VaultStore
	Encrypter ports.Encrypter
	FS        ports.FileSystem
}

func (DoctorService) Run

func (s DoctorService) Run(ctx context.Context, root string) (DoctorReport, error)

type ImportOptions

type ImportOptions struct {
	Strategy MergeStrategy
	Resolver ConflictResolver
}

type ImportReport

type ImportReport struct {
	Added    int
	Updated  int
	Skipped  int
	Warnings []string
}

type InitOptions

type InitOptions struct {
	Root       string
	Name       string
	Recipients []string
	Force      bool
	InitGit    bool
}

type InitService

type InitService struct {
	Store VaultStore
	Git   ports.Git
	Clock ports.Clock
}

func (InitService) Init

func (s InitService) Init(ctx context.Context, opts InitOptions) error

type KeysService

type KeysService struct {
	Store     VaultStore
	Encrypter ports.Encrypter
}

func (KeysService) Add

func (s KeysService) Add(root, recipient string) error

func (KeysService) List

func (s KeysService) List(root string) ([]string, error)

func (KeysService) Remove

func (s KeysService) Remove(root, recipient string) error

func (KeysService) Rotate

func (s KeysService) Rotate(ctx context.Context, root string) (RotateReport, error)

type ListingService

type ListingService struct {
	Store VaultStore
}

func (ListingService) FindKeys

func (s ListingService) FindKeys(root, pattern string) ([]string, error)

func (ListingService) ListAllKeys

func (s ListingService) ListAllKeys(root string) ([]domain.KeyInfo, error)

func (ListingService) ListEnvs

func (s ListingService) ListEnvs(root, project string) ([]string, error)

func (ListingService) ListKeys

func (s ListingService) ListKeys(root, project, env string) ([]domain.KeyInfo, error)

func (ListingService) ListProjects

func (s ListingService) ListProjects(root string) ([]string, error)

type MergeStrategy

type MergeStrategy string
const (
	MergePreferVault MergeStrategy = "prefer-vault"
	MergePreferFile  MergeStrategy = "prefer-file"
	MergeInteractive MergeStrategy = "interactive"
)

type RotateReport

type RotateReport struct {
	Total   int
	Rotated int
	Failed  int
	Errors  []string
}

type SecretService

type SecretService struct {
	Store     VaultStore
	Encrypter ports.Encrypter
	Clock     ports.Clock
}

func (SecretService) ExportEnv

func (s SecretService) ExportEnv(ctx context.Context, root, project, env string) ([]byte, error)

func (SecretService) ImportEnv

func (s SecretService) ImportEnv(ctx context.Context, root, project, env string, input []byte, options ImportOptions) (ImportReport, error)

func (SecretService) Set

func (s SecretService) Set(ctx context.Context, root, project, env, key, value string) error

func (SecretService) Unset

func (s SecretService) Unset(ctx context.Context, root, project, env, key string) error

type SyncService

type SyncService struct {
	Git ports.Git
}

func (SyncService) Pull

func (s SyncService) Pull(ctx context.Context, root string, allowDirty bool) error

func (SyncService) Push

func (s SyncService) Push(ctx context.Context, root string, allowDirty bool) error

type VaultStore

type VaultStore struct {
	FS ports.FileSystem
}

func (VaultStore) ConfigPath

func (s VaultStore) ConfigPath(root string) string

func (VaultStore) EnsureLayout

func (s VaultStore) EnsureLayout(root string) error

func (VaultStore) IndexPath

func (s VaultStore) IndexPath(root string) string

func (VaultStore) ListSecretFiles

func (s VaultStore) ListSecretFiles(root string) ([]string, error)

func (VaultStore) LoadConfig

func (s VaultStore) LoadConfig(root string) (domain.Config, error)

func (VaultStore) LoadIndex

func (s VaultStore) LoadIndex(root string) (domain.Index, error)

func (VaultStore) SaveConfig

func (s VaultStore) SaveConfig(root string, cfg domain.Config) error

func (VaultStore) SaveIndex

func (s VaultStore) SaveIndex(root string, idx domain.Index) error

func (VaultStore) SecretFilePath

func (s VaultStore) SecretFilePath(root, project, env string) string

func (VaultStore) SecretsDir

func (s VaultStore) SecretsDir(root string) string

Jump to

Keyboard shortcuts

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