groups

package
v3.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PKG_TYPE_CONDITIONAL uint8 = 0
	PKG_TYPE_OPTIONAL    uint8 = 1
	PKG_TYPE_DEFAULT     uint8 = 2
	PKG_TYPE_MANDATORY   uint8 = 3
)

Variables

This section is empty.

Functions

func Write

func Write(comps *Comps, file string) error

Write writes information about groups, categories and environment to given file

func WriteGz

func WriteGz(comps *Comps, file string) error

Write writes compressed information about groups, categories and environment to given file

Types

type Category

type Category struct {
	ID          string     `xml:"id"`
	Name        *LocString `xml:"name"`
	Description *LocString `xml:"description"`
	Groups      []string   `xml:"grouplist>groupid"`
}

Category contains info about category

type Comps

type Comps struct {
	Groups       []*Group       `xml:"group"`
	Categories   []*Category    `xml:"category"`
	Environments []*Environment `xml:"environment"`
	Langpacks    []*Langpack    `xml:"langpacks>match"`
}

Comps contains info about groups

func Read

func Read(file string) (*Comps, error)

Read reads and parses comps.xml file

func ReadGz

func ReadGz(file string) (*Comps, error)

ReadGz reads, uncopresses and parses comps.xml.gz file

type Environment

type Environment struct {
	ID           string     `xml:"id"`
	Name         *LocString `xml:"name"`
	Description  *LocString `xml:"description"`
	DisplayOrder int        `xml:"display_order"`
	Groups       []string   `xml:"grouplist>groupid"`
	Options      []string   `xml:"optionlist>groupid"`
}

Environment contains environment info

type Group

type Group struct {
	ID          string          `xml:"id"`
	Name        *LocString      `xml:"name"`
	IsDefault   bool            `xml:"default"`
	IsVisible   bool            `xml:"uservisible"`
	Description *LocString      `xml:"description"`
	Packages    []*GroupPackage `xml:"packagelist>packagereq"`
}

Group contains info about package group

type GroupPackage

type GroupPackage struct {
	Type         uint8
	BaseArchOnly bool
	Arch         []string
	Name         string
	Requires     string
}

GroupPackage contains info about package in group

func (*GroupPackage) UnmarshalXML

func (p *GroupPackage) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML is custom unmarshaller for group info

type Langpack

type Langpack struct {
	Install string `xml:"install,attr"`
	Name    string `xml:"name,attr"`
}

Langpack contains info about language pack

type LocString

type LocString struct {
	Default   string
	Localized map[string]string
}

LocString is collection of localized strings

func (*LocString) Get

func (s *LocString) Get(lang string) string

Get returns value on given language

func (*LocString) Num

func (s *LocString) Num() int

Num returns number of localized strings

func (*LocString) String

func (s *LocString) String() string

String returns default (english) value

func (*LocString) UnmarshalXML

func (s *LocString) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML is custom unmarshaller for localized info

Jump to

Keyboard shortcuts

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