bundle

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBundlePath

func CreateBundlePath(bundleName, apiID string) (string, error)

CreateBundlePath returns the absolute path for a bundle, consisting of the combined API ID and hashed bundle name.

func LoadBundleManifest

func LoadBundleManifest(bundle *Bundle, skipVerification bool) error

LoadBundleManifest will parse the manifest file and return the bundle parameters.

func SaveBundle

func SaveBundle(bundle *Bundle, destPath string) error

SaveBundle will save a bundle to the disk, see ZipBundleSaver methods for reference.

func SaveBundleZip

func SaveBundleZip(bundle *Bundle, apiID, bundleName string) error

Types

type Bundle

type Bundle struct {
	Manifest apidef.BundleManifest
	Name     string
	Path     string
	Data     []byte
}

Bundle is the basic bundle data structure. It holds the bundle name and the data.

func LoadBundle

func LoadBundle(apiID, bundleName string) (*Bundle, error)

func (*Bundle) Verify

func (b *Bundle) Verify() error

Verify performs a signature verification on the bundle file.

type Getter

type Getter interface {
	Get() ([]byte, error)
}

Getter is used for downloading bundle data, see HttpBundleGetter for reference.

type HTTPBundleGetter

type HTTPBundleGetter struct {
	URL string
}

HTTPBundleGetter is a simple HTTP Getter.

func (*HTTPBundleGetter) Get

func (g *HTTPBundleGetter) Get() ([]byte, error)

Get performs an HTTP GET request.

type Saver

type Saver interface {
	Save(*Bundle, string) error
}

Saver is an interface used by bundle saver structures.

type ZipBundleSaver

type ZipBundleSaver struct{}

ZipBundleSaver is a Saver for ZIP files.

func (ZipBundleSaver) Save

func (ZipBundleSaver) Save(bundle *Bundle, bundlePath string) error

Save implements the main method of the Saver interface. It makes use of archive/zip.

Jump to

Keyboard shortcuts

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