manifestgo

package module
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: MIT Imports: 16 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

manifestgo

Build pkg manifest files

Documentation

Index

Constants

View Source
const ReadSizeLimit = 32768

Variables

This section is empty.

Functions

func Sha256SumReader

func Sha256SumReader(r io.Reader) (hash.Hash, error)

Types

type Asset

type Asset struct {
	Kind       string   `plist:"kind" json:"kind"`
	MD5Size    int64    `plist:"md5-size,omitempty" json:"md5_size,omitempty"`
	MD5s       []string `plist:"md5s,omitempty" json:"md5_hash_strings,omitempty"`
	SHA256Size int64    `plist:"sha256-size,omitempty" json:"sha256_size,omitempty"`
	SHA256s    []string `plist:"sha256s,omitempty" json:"sha256_hash_strings,omitempty"`
	URL        string   `plist:"url" json:"url"`
}

Asset represents an asset

type Bundle

type Bundle struct {
	ID      string `xml:"id,attr"`
	Path    string `xml:"path,attr"`
	Version string `xml:"CFBundleVersion,attr"`
}

type Choice added in v0.2.1

type Choice struct {
	ID          string   `xml:"id,attr"`
	Title       string   `xml:"title,attr"`
	Description string   `xml:"description,attr"`
	PkgRef      []PkgRef `xml:"pkg-ref"`
}

type Item

type Item struct {
	Assets   []*Asset  `plist:"assets" json:"assets"`
	Metadata *Metadata `plist:"metadata" json:"metadata"`
}

Item represents an item

type Line added in v0.2.1

type Line struct {
	Choice string `xml:"choice,attr"`
}

type Manifest

type Manifest struct {
	ManifestItems []*Item `plist:"items" json:"manifestItems"`
}

Manifest handles the manifest for install application command

func BuildPackageManifest

func BuildPackageManifest(p *Package) (*Manifest, error)

func (*Manifest) AsEncodedPlistString

func (m *Manifest) AsEncodedPlistString(indent int) (string, error)

func (*Manifest) AsJSON

func (m *Manifest) AsJSON(indent int) ([]byte, error)

func (*Manifest) AsPlist

func (m *Manifest) AsPlist(indent int) ([]byte, error)

type Metadata

type Metadata struct {
	BundleIdentifier string `plist:"bundle-identifier" json:"bundle_identifier"`
	BundleVersion    string `plist:"bundle-version" json:"bundle_version"`
	Kind             string `plist:"kind" json:"kind"`
	Title            string `plist:"title" json:"title"`
}

Metadata stores the command meta-data

type Package

type Package struct {
	Choice  Choice   `xml:"choice"`
	PkgInfo PkgInfo  `xml:"pkg-info"`
	PkgRef  []PkgRef `xml:"pkg-ref"`
	Title   string   `xml:"title"`
	Hashes  []hash.Hash
	URL     string
	Size    int64

	// Resource info
	ContentLength int64
	Etag          string
	// contains filtered or unexported fields
}

func NewPackage added in v0.2.1

func NewPackage(pr PackageReader, hashTypeSize uint, hashChunkSize int64) *Package

func ReadPkgFile

func ReadPkgFile(name string) (*Package, error)

func (*Package) AsJSON

func (p *Package) AsJSON(indent int) ([]byte, error)

func (*Package) BuildManifest

func (p *Package) BuildManifest() (*Manifest, error)

func (*Package) GetBundleIdentifier

func (p *Package) GetBundleIdentifier() string

func (*Package) GetHashStrings added in v0.2.1

func (p *Package) GetHashStrings() []string

func (*Package) GetKind

func (p *Package) GetKind() string

func (*Package) GetPath added in v0.2.1

func (p *Package) GetPath() string

func (*Package) GetTitle

func (p *Package) GetTitle() string

func (*Package) GetVersion added in v0.2.1

func (p *Package) GetVersion() string

func (*Package) HasValidSignature added in v0.2.3

func (p *Package) HasValidSignature() bool

func (*Package) IsDistribution added in v0.2.4

func (p *Package) IsDistribution() bool

func (*Package) IsSigned added in v0.2.3

func (p *Package) IsSigned() bool

func (*Package) ReadFromURL

func (p *Package) ReadFromURL() error

func (*Package) SignatureError added in v0.2.4

func (p *Package) SignatureError() error

type PackageReader added in v0.2.1

type PackageReader interface {
	HashURL(uint) ([]hash.Hash, error)
	Length() int64
	Etag() string
	URL() string
	ReadAt(p []byte, off int64) (n int, err error)
}

type PkgInfo added in v0.2.1

type PkgInfo struct {
	Identifier string   `xml:"identifier,attr"`
	Version    string   `xml:"version,attr"`
	Bundle     []Bundle `xml:"bundle"`
}

type PkgRef

type PkgRef struct {
	Bundle            []Bundle `xml:"bundle-version>bundle"`
	ID                string   `xml:"id,attr"`
	PackageIdentifier string   `xml:"packageIdentifier,attr"`
	Version           string   `xml:"version,attr"`
	Package           string
}

Directories

Path Synopsis
cli
cmd
Package xar provides for reading and writing XAR archives.
Package xar provides for reading and writing XAR archives.

Jump to

Keyboard shortcuts

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