imagemetadata

package
v0.0.0-...-acd7349 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2013 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

The imagemetadata package supports locating, parsing, and filtering Ubuntu image metadata in simplestreams format. See http://launchpad.net/simplestreams and in particular the doc/README file in that project for more information about the file formats.

Index

Constants

View Source
const (
	DefaultIndexPath = "streams/v1/index"
)

Variables

View Source
var DefaultBaseURL = "http://cloud-images.ubuntu.com/releases"

This needs to be a var so we can override it for testing.

Functions

func Boilerplate

func Boilerplate(name, series string, im *ImageMetadata, cloudSpec *CloudSpec) ([]string, error)

func DecodeCheckSignature

func DecodeCheckSignature(r io.Reader) ([]byte, error)

DecodeCheckSignature parses the inline signed PGP text, checks the signature, and returns plain text if the signature matches.

Types

type CloudSpec

type CloudSpec struct {
	Region   string
	Endpoint string
}

CloudSpec uniquely defines a specific cloud deployment.

type ImageConstraint

type ImageConstraint struct {
	CloudSpec
	Series string
	Arches []string
	Stream string // may be "", typically "release", "daily" etc
}

ImageConstraint defines criteria used to find an image.

func (*ImageConstraint) Ids

func (ic *ImageConstraint) Ids() ([]string, error)

Generates a string array representing product ids formed similarly to an ISCSI qualified name (IQN).

type ImageMetadata

type ImageMetadata struct {
	Id          string `json:"id"`
	Storage     string `json:"root_store"`
	VType       string `json:"virt"`
	Arch        string `json:"arch"`
	RegionAlias string `json:"crsn"`
	RegionName  string `json:"region"`
	Endpoint    string `json:"endpoint"`
}

ImageMetadata holds information about a particular cloud image.

func Fetch

func Fetch(baseURLs []string, indexPath string, ic *ImageConstraint, onlySigned bool) ([]*ImageMetadata, error)

Fetch returns a list of images for the specified cloud matching the constraint. The base URL locations are as specified - the first location which has a file is the one used. Signed data is preferred, but if there is no signed data available and onlySigned is false, then unsigned data is used.

func GetLatestImageIdMetadata

func GetLatestImageIdMetadata(data []byte, ic *ImageConstraint) ([]*ImageMetadata, error)

GetLatestImageIdMetadata is provided so it can be call by tests outside the simplestreams package.

type NotPGPSignedError

type NotPGPSignedError struct{}

NotPGPSignedError is used when PGP text does not contain an inline signature.

func (*NotPGPSignedError) Error

func (*NotPGPSignedError) Error() string

Jump to

Keyboard shortcuts

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