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 ¶
const (
DefaultIndexPath = "streams/v1/index"
)
Variables ¶
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)
Types ¶
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