store

package
v0.0.0-...-ba43356 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LocalDefaultFileName = "config.yml"
)

Variables

View Source
var LoadConfiguration = func() (*Configuration, error) {
	s, err := NewLocal(nil)
	if err != nil {
		return nil, err
	}

	return s.LoadConfiguration()
}
View Source
var LocalDefaultLocation = func() string {
	return fmt.Sprintf("%s/.config/system-configurator", resolveHomeDir())
}
View Source
var WriteConfiguration = func(cfg *Configuration) error {
	s, err := NewLocal(nil)
	if err != nil {
		return err
	}

	return s.WriteConfiguration(cfg)
}

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Packages []*model.Package `yaml:"packages"`
}

func (*Configuration) AddPackage

func (c *Configuration) AddPackage(pkg *model.Package) error

func (*Configuration) FindPackage

func (c *Configuration) FindPackage(name string) (*model.Package, int)

func (*Configuration) RemovePackage

func (c *Configuration) RemovePackage(name string) error

func (*Configuration) ResolvedPkgs

func (c *Configuration) ResolvedPkgs() ([]*model.Package, error)

type LocalCfg

type LocalCfg struct {
	Location string
	FileName string
}

type Store

type Store interface {
	LoadConfiguration() (*Configuration, error)
	WriteConfiguration(*Configuration) error
}

func NewLocal

func NewLocal(cfg *LocalCfg) (s Store, err error)

Jump to

Keyboard shortcuts

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