manifest

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MConditionHost  ManifestConditionalType = "host"
	MConditionGroup ManifestConditionalType = "group"
	TypePackage     ManifestObjectType      = "package"
	TypeDependency  ManifestObjectType      = "dependency"
)

Functions

func Filter

func Filter(pmManifest PmManifest) (packages []string, dependencies []string, err error)

func MatchConditional

func MatchConditional(c Conditional) (match bool, err error)

Types

type Conditional

type Conditional struct {
	Type         ManifestConditionalType `yaml:"type"`
	Value        string                  `yaml:"value"`
	Dependencies []string                `yaml:"dependencies"`
	Packages     []string                `yaml:"packages"`
}

type Global

type Global struct {
	Dependencies []string `yaml:"dependencies"`
	Packages     []string `yaml:"packages"`
}

type Manifest

type Manifest struct {
	Dnf     PmManifest `yaml:"dnf"`
	Git     PmManifest `yaml:"git"`
	Go      PmManifest `yaml:"go"`
	Version string     `yaml:"_version"`
}

func InitManifest

func InitManifest() (Manifest, error)

func (*Manifest) AddConditional

func (m *Manifest) AddConditional(oType ManifestObjectType, pmName shared.ManagerName, cType ManifestConditionalType, cValue string, objects []string) error

func (*Manifest) AddGlobal

func (m *Manifest) AddGlobal(oType ManifestObjectType, pmName shared.ManagerName, objects []string) error

func (*Manifest) AddToGroup

func (m *Manifest) AddToGroup(toAdd []string, group string, pmName shared.ManagerName, oType ManifestObjectType) error

func (*Manifest) AddToHost

func (m *Manifest) AddToHost(toAdd []string, pmName shared.ManagerName, oType ManifestObjectType) error

FIXME: Somhow os.Hostname needs to be moved to an interface

func (*Manifest) Pm

func (m *Manifest) Pm(name shared.ManagerName) PmManifest

func (*Manifest) RemoveConditional

func (m *Manifest) RemoveConditional(oType ManifestObjectType, pmName shared.ManagerName, cType ManifestConditionalType, cValue string, objects []string) error

func (*Manifest) RemoveGlobal

func (m *Manifest) RemoveGlobal(oType ManifestObjectType, pmName shared.ManagerName, objects []string) error

func (*Manifest) Save

func (m *Manifest) Save(filename string) error

type ManifestConditionalType

type ManifestConditionalType string

type ManifestFace

type ManifestFace interface {
	Save(filename string) error
	Pm(name shared.ManagerName) PmManifest
	AddConditional(oType ManifestObjectType, pmName shared.ManagerName, cType ManifestConditionalType, cValue string, objects []string) error
	RemoveConditional(oType ManifestObjectType, pmName shared.ManagerName, cType ManifestConditionalType, cValue string, objects []string) error
	AddGlobal(oType ManifestObjectType, pmName shared.ManagerName, objects []string) error
	RemoveGlobal(oType ManifestObjectType, pmName shared.ManagerName, objects []string) error

	AddToHost(toAdd []string, pmName shared.ManagerName, oType ManifestObjectType) error
	AddToGroup(toAdd []string, group string, pmName shared.ManagerName, oType ManifestObjectType) error
}

type ManifestObjectType

type ManifestObjectType string

type PmManifest

type PmManifest struct {
	Global      Global        `yaml:"global"`
	Conditional []Conditional `yaml:"conditional"`
}

Jump to

Keyboard shortcuts

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