appmanifest

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 4 Imported by: 5

Documentation

Overview

package appmanifest provides utilities for managing app manifest files used by MDM InstallApplication commands.

Index

Constants

View Source
const DefaultMD5Size = 10 << 20 // 10MB

DefaultMD5Size is the default size of each file chunk that needs to be hashed

Variables

This section is empty.

Functions

This section is empty.

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:"md5s,omitempty"`
	SHA256Size int64    `plist:"sha256-size,omitempty" json:"sha256-size,omitempty"`
	SHA256s    []string `plist:"sha256s,omitempty" json:"sha256s,omitempty"`
	URL        string   `plist:"url" json:"url"`
}

type BundleInfo

type BundleInfo struct {
	BundleIdentifier string `plist:"bundle-identifier" json:"bundle-identifier"`
	BundleVersion    string `plist:"bundle-version" json:"bundle-version"`
}

type File

type File interface {
	io.Reader
	Size() int64
}

File is an io.Reader which knows its size.

type Item

type Item struct {
	Assets []Asset `plist:"assets" json:"assets"`
	// Apple claims the metadata struct is required,
	// but testing shows otherwise.
	Metadata *Metadata `plist:"metadata,omitempty" json:"metadata,omitempty"`
}

type Manifest

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

http://help.apple.com/deployment/osx/#/ior5df10f73a

func Create

func Create(file File, url string, opts ...Option) (*Manifest, error)

Create an AppManifest and write it to an io.Writer.

type Metadata

type Metadata struct {
	BundleInfo
	Items       []BundleInfo `plist:"items,omitempty" json:"items,omitempty"`
	Kind        string       `plist:"kind" json:"kind"`
	Subtitle    string       `plist:"subtitle" json:"subtitle"`
	Title       string       `plist:"title" json:"title"`
	SizeInBytes int64        `plist:"sizeInBytes,omitempty" json:"sizeInBytes,omitempty"`
}

type Option

type Option func(*config)

func WithMD5Size

func WithMD5Size(md5Size int64) Option

WithMD5Size overrides the DefaultMD5Size when creating an AppManifest.

Jump to

Keyboard shortcuts

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