peclpkg

package
v0.0.0-...-f459114 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Changelog

type Changelog struct {
	Releases []Release `xml:"release"`
}

Changelog contains all the releases of a specific Package.

type ConfigureOption

type ConfigureOption struct {
	Name    string `xml:"name,attr"`
	Default string `xml:"default,attr"`
	Prompt  string `xml:"prompt,attr"`
}

type Dependencies

type Dependencies struct {
	Required RequiredDependencies `xml:"required"`
	Optional OptionalDependencies `xml:"optional"`
}

type ExtSrcRelease

type ExtSrcRelease struct {
	ConfigureOptions []ConfigureOption `xml:"configureoption"`
}

type ExtensionConstraint

type ExtensionConstraint struct {
	Name    string   `xml:"name"`
	Min     string   `xml:"min"`
	Max     string   `xml:"max"`
	Exclude []string `xml:"exclude"`
}

type License

type License struct {
	Name string `xml:",chardata"`
	URI  string `xml:"uri,attr"`
}

type OptionalDependencies

type OptionalDependencies struct {
	Extensions []ExtensionConstraint `xml:"extension"`
}

type PHPConstraint

type PHPConstraint struct {
	Min     string   `xml:"min"`
	Max     string   `xml:"max"`
	Exclude []string `xml:"exclude"`
}

type Package

type Package struct {
	Name          string           `xml:"name"`
	Summary       string           `xml:"summary"`
	Description   string           `xml:"description"`
	PublishDate   string           `xml:"date"`
	PublishTime   string           `xml:"time"`
	User          string           `xml:"user"`
	Email         string           `xml:"email"`
	Version       Version          `xml:"version"`
	Stability     PackageStability `xml:"stability"`
	License       License          `xml:"license"`
	Dependencies  Dependencies     `xml:"dependencies"`
	ExtSrcRelease ExtSrcRelease    `xml:"extsrcrelease"`
	Changelog     Changelog        `xml:"changelog"`
}

Package represents a package.xml file.

func LoadPackageXML

func LoadPackageXML(r io.Reader) (Package, error)

LoadPackageXML reads an XML file from the given io.Reader and transforms it into a Package struct.

func LoadPackageXMLFromFile

func LoadPackageXMLFromFile(xmlpath string) (Package, error)

LoadPackageXMLFromFile loads the XML file at xmlpath and converts it into a Package struct.

type PackageStability

type PackageStability struct {
	Release Stability `xml:"release"`
	API     Stability `xml:"api"`
}

type Release

type Release struct {
	Date      string           `xml:"date"`
	Time      string           `xml:"time"`
	Version   Version          `xml:"version"`
	Stability PackageStability `xml:"stability"`
	Notes     string           `xml:"notes"`
}

Release contains all the metadata about a single release as provided by package.xml files.

type RequiredDependencies

type RequiredDependencies struct {
	PHP        PHPConstraint         `xml:"php"`
	Extensions []ExtensionConstraint `xml:"extension"`
}

type Stability

type Stability string
var (
	Snapshot Stability = "snapshot"
	Devel    Stability = "devel"
	Alpha    Stability = "alpha"
	Beta     Stability = "beta"
	Stable   Stability = "stable"
)

func (*Stability) UnmarshalText

func (s *Stability) UnmarshalText(text []byte) error

type Version

type Version struct {
	Release string `xml:"release"`
	API     string `xml:"api"`
}

Jump to

Keyboard shortcuts

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