Documentation ¶
Overview ¶
Package imagedownloads implements image-downloads metadata from simplestreams.
Index ¶
- Constants
- func DefaultSource(factory simplestreams.DataSourceFactory) func() simplestreams.DataSource
- func Filter(ftype string) simplestreams.AppendMatchingFunc
- func NewDataSource(factory simplestreams.DataSourceFactory, baseURL string) simplestreams.DataSource
- func Sort(metadata []*Metadata)
- type Metadata
Constants ¶
const (
// DataType is the simplestreams datatype.
DataType = "image-downloads"
)
Variables ¶
This section is empty.
Functions ¶
func DefaultSource ¶
func DefaultSource(factory simplestreams.DataSourceFactory) func() simplestreams.DataSource
DefaultSource creates a new signed simplestreams datasource for use with the image-downloads datatype.
func Filter ¶
func Filter(ftype string) simplestreams.AppendMatchingFunc
Filter collects only matching products. Release and Arch are filtered by imagemetadata.ImageConstraints. So this really only let's us filter on a file type.
func NewDataSource ¶
func NewDataSource(factory simplestreams.DataSourceFactory, baseURL string) simplestreams.DataSource
NewDataSource returns a new simplestreams.DataSource from the provided baseURL. baseURL MUST include the image stream.
Types ¶
type Metadata ¶
type Metadata struct { Arch string `json:"arch,omitempty"` Release string `json:"release,omitempty"` Version string `json:"version,omitempty"` FType string `json:"ftype,omitempty"` SHA256 string `json:"sha256,omitempty"` Path string `json:"path,omitempty"` Size int64 `json:"size,omitempty"` }
Metadata models the information about a particular cloud image download product.
func Fetch ¶
func Fetch( fetcher imagemetadata.SimplestreamsFetcher, src []simplestreams.DataSource, cons *imagemetadata.ImageConstraint, ff simplestreams.AppendMatchingFunc) ([]*Metadata, *simplestreams.ResolveInfo, error)
Fetch gets product results as Metadata from the provided datasources, given some constraints and an optional filter function.
func One ¶
func One(fetcher imagemetadata.SimplestreamsFetcher, arch, release, stream, ftype string, src func() simplestreams.DataSource) (*Metadata, error)
One gets Metadata for one content download item: The most recent of:
- architecture
- OS release
- Simplestreams stream
- File image type.
src exists to pass in a data source for testing.