Documentation ¶
Index ¶
- Variables
- type PackageTag
- type PackagesTag
- type PdscTag
- type PdscXML
- func (p *PdscXML) AllReleases() []string
- func (p *PdscXML) Dependencies() [][]string
- func (p *PdscXML) FindReleaseTagByVersion(version string) *ReleaseTag
- func (p *PdscXML) LatestVersion() string
- func (p *PdscXML) PackURL(version string) string
- func (p *PdscXML) Read() error
- func (p *PdscXML) Tag() PdscTag
- type PidxXML
- type ReleaseTag
Constants ¶
This section is empty.
Variables ¶
var (
PdscIndexNotFound = -1
)
Functions ¶
This section is empty.
Types ¶
type PackageTag ¶ added in v0.9.1
type PackageTag struct { XMLName xml.Name `xml:"package"` Vendor string `xml:"vendor,attr"` Name string `xml:"name,attr"` Version string `xml:"version,attr"` }
Package represents a direct dependency/requirement of this package
type PackagesTag ¶ added in v0.9.1
type PackagesTag struct { XMLName xml.Name `xml:"packages"` Packages []PackageTag `xml:"package"` }
PackagesTag only has one possible child, which is <package>
type PdscTag ¶
type PdscTag struct { XMLName xml.Name `xml:"pdsc"` Vendor string `xml:"vendor,attr"` URL string `xml:"url,attr"` Name string `xml:"name,attr"` Version string `xml:"version,attr"` }
PdscTag maps a <pdsc> tag that goes in PIDX files.
func (*PdscTag) PackURL ¶ added in v0.3.0
PackURL constructs a URL of a pack using the tag's attributes.
func (*PdscTag) YamlPackID ¶ added in v0.5.0
YamlPackId formats the packId as specified in https://github.com/Open-CMSIS-Pack/devtools/blob/tools/toolbox/0.10.0/tools/projmgr/docs/Manual/YML-Format.md#pack-name-conventions
type PdscXML ¶
type PdscXML struct { XMLName xml.Name `xml:"package"` Vendor string `xml:"vendor"` URL string `xml:"url"` Name string `xml:"name"` License string `xml:"license"` ReleasesTag struct { XMLName xml.Name `xml:"releases"` Releases []ReleaseTag `xml:"release"` } `xml:"releases"` RequirementsTag struct { XMLName xml.Name `xml:"requirements"` Packages []PackagesTag `xml:"packages"` } `xml:"requirements"` FileName string }
PdscXML maps few tags of a PDSC file. Ref: https://github.com/Open-CMSIS-Pack/Open-CMSIS-Pack-Spec/blob/main/schema/PACK.xsd
func NewPdscXML ¶
NewPdscXML receives a PDSC file name to be later read into the PdscXML struct
func (*PdscXML) AllReleases ¶ added in v0.4.0
AllReleases returns a slice of strings containing all available releases in this Pdsc file
func (*PdscXML) Dependencies ¶ added in v0.9.1
Dependencies returns all the listed packs that need to be installed alongside, as per the <requirements> section. It returns a [][]string array containing the packs in [<Name>, <Vendor>, <Version>] format. <Version> is an internal interpretation: latest -> install the latest available x.y.z:x.y.z -> install exact version a.b.c:x.y.z -> install latest ranging from a.b.c to x.y.z x.y.z:_ -> install latest newer than x.y.z Ref: https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/element_requirements_pg.html#element_packages
func (*PdscXML) FindReleaseTagByVersion ¶ added in v0.3.0
func (p *PdscXML) FindReleaseTagByVersion(version string) *ReleaseTag
FindReleaseTagByVersion iterates over the PDSC file's releases tag and returns the release that matching version.
func (*PdscXML) LatestVersion ¶
LatestVersion returns a string containing version of the first tag within the <releases> tag.
func (*PdscXML) PackURL ¶ added in v0.3.0
PackURL returns a url for the Pack described in this PDSC file
type PidxXML ¶
type PidxXML struct { XMLName xml.Name `xml:"index"` SchemaVersion string `xml:"schemaVersion,attr"` Vendor string `xml:"vendor"` URL string `xml:"url"` Pindex struct { XMLName xml.Name `xml:"pindex"` Pdscs []PdscTag `xml:"pdsc"` } `xml:"pindex"` // contains filtered or unexported fields }
PidxXML maps the PIDX file format. Ref: https://github.com/ARM-software/CMSIS_5/blob/develop/CMSIS/Utilities/PackIndex.xsd
func NewPidxXML ¶
NewPidxXML creates a new instance of the PidxXML struct.
func (*PidxXML) FindPdscTags ¶ added in v0.5.0
FindPdscTags takes in a sample pdscTag and returns the actual PDSC tag inside this PidxXML.
func (*PidxXML) HasPdsc ¶
HasPdsc tells whether of not pdsc is already present in this pidx file. It returns the index of the matching pdsc tag, or -1 if not found
func (*PidxXML) ListPdscTags ¶ added in v0.5.0
ListPdscTags returns a map of PdscTags in the pidx document
func (*PidxXML) Read ¶
Read reads FileName into this PidxXML struct and allocates memory for all PDSC tags.
func (*PidxXML) RemovePdsc ¶
RemovePdsc takes in a PdscTag and remove it from the <pindex> tag.