config

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConfigNotFound = fmt.Errorf("config not found")

Functions

func FindPlan added in v1.3.0

func FindPlan(cfg *v1.Config, planID string) *v1.Plan

func FindRepo added in v1.3.0

func FindRepo(cfg *v1.Config, repoID string) *v1.Repo

func FindRepoByGUID added in v1.7.0

func FindRepoByGUID(cfg *v1.Config, guid string) *v1.Repo

func NewDefaultConfig

func NewDefaultConfig() *v1.Config

func PopulateRequiredFields added in v1.9.0

func PopulateRequiredFields(config *v1.Config) (mutated bool, err error)

func RehydrateNetworkSanitizedConfig added in v1.9.0

func RehydrateNetworkSanitizedConfig(sanitized *v1.Config, full *v1.Config) *v1.Config

func SanitizeForNetwork added in v1.9.0

func SanitizeForNetwork(config *v1.Config) *v1.Config

func ValidateConfig

func ValidateConfig(c *v1.Config) error

Types

type ConfigManager added in v1.7.0

type ConfigManager struct {
	Store    ConfigStore
	OnChange eventemitter.EventEmitter[struct{}]
	// contains filtered or unexported fields
}

func (*ConfigManager) Get added in v1.7.0

func (m *ConfigManager) Get() (*v1.Config, error)

func (*ConfigManager) Transform added in v1.13.0

func (m *ConfigManager) Transform(fn func(cfg *v1.Config) (*v1.Config, error)) error

Transform atomically reads the current config, passes a deep clone to fn, and saves the result. If fn returns a nil config, no update is performed. The caller should not call Get/Update on the ConfigManager from within fn.

func (*ConfigManager) Update added in v1.7.0

func (m *ConfigManager) Update(config *v1.Config) error

type ConfigStore

type ConfigStore interface {
	Get() (*v1.Config, error)
	Update(config *v1.Config) error
	// Transform atomically reads the current config, passes a deep clone to fn,
	// and if fn returns a non-nil config, saves it. Returning (nil, nil) skips the update.
	Transform(fn func(cfg *v1.Config) (*v1.Config, error)) error
}

type JsonFileStore

type JsonFileStore struct {
	Path string
	// contains filtered or unexported fields
}

func (*JsonFileStore) Get

func (f *JsonFileStore) Get() (*v1.Config, error)

func (*JsonFileStore) Transform added in v1.13.0

func (f *JsonFileStore) Transform(fn func(cfg *v1.Config) (*v1.Config, error)) error

func (*JsonFileStore) Update

func (f *JsonFileStore) Update(config *v1.Config) error

type MemoryStore

type MemoryStore struct {
	Config *v1.Config
	// contains filtered or unexported fields
}

func (*MemoryStore) Get

func (c *MemoryStore) Get() (*v1.Config, error)

func (*MemoryStore) Transform added in v1.13.0

func (c *MemoryStore) Transform(fn func(cfg *v1.Config) (*v1.Config, error)) error

func (*MemoryStore) Update

func (c *MemoryStore) Update(config *v1.Config) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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