config

package
v0.0.1-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: GPL-3.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// path that houses config, lockfile, etc
	ConfigPath = "/etc/pakket"
	// Path to main pakket config
	ConfigFile = path.Join(ConfigPath, "config.toml")
	// Path to lockfile w/ currently installed packages
	LockfilePath = path.Join(ConfigPath, "lockfile.toml")
	// Path to local database
	LocalPath = path.Join(ConfigPath, "local")
)

Functions

func GetConfig

func GetConfig() (err error)

func GetLockfile

func GetLockfile() (err error)

func WriteConfig

func WriteConfig() (err error)

Types

type ConfigStruct

type ConfigStruct struct {
	Mirrors   []Mirror `toml:"mirrors"`
	Community bool     `toml:"community"`
	Paths     Paths    `toml:"paths"`
}
var (
	// Config
	C ConfigStruct
)

type LockfileMetadata

type LockfileMetadata struct {
	Name       string `toml:"name"`
	Version    string `toml:"version"`
	Checksum   string `toml:"checksum"`
	Repository string `toml:"repository"`
}

func NewMetadata

func NewMetadata(name, version, checksum, repository string) LockfileMetadata

type LockfileStruct

type LockfileStruct struct {
	Packages map[string]LockfileMetadata `toml:"packages" mapstructure:"packages"`
}
var (
	Lockfile LockfileStruct
)

func (*LockfileStruct) Add

func (lock *LockfileStruct) Add(metadata LockfileMetadata, files []string) (err error)

Add package information to lockfile

func (*LockfileStruct) Exists

func (lock *LockfileStruct) Exists(pkgName string) bool

func (*LockfileStruct) Remove

func (lock *LockfileStruct) Remove(name string) (lockfileData *LockfileMetadata, files []string, err error)

Remove package information from lockfile

type Mirror

type Mirror struct {
	URL  string `toml:"url"`
	Name string `toml:"name"`
}

type Paths

type Paths struct {
	// absolute path to temp downloads directory (ie /var/tmp/pakket)
	Downloads string `toml:"downloads"`
	// installation prefix. must be "/usr/local", other values are currently not supported
	Prefix string `toml:"prefix"`
}

Jump to

Keyboard shortcuts

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