Documentation ¶
Index ¶
- type DownloadableFile
- type Product
- type ProductVersion
- type ProductVersionItem
- type Products
- type SimpleStreams
- func (s *SimpleStreams) GetAlias(imageType string, name string) (*api.ImageAliasesEntry, error)
- func (s *SimpleStreams) GetAliasArchitectures(imageType string, name string) (map[string]*api.ImageAliasesEntry, error)
- func (s *SimpleStreams) GetFiles(fingerprint string) (map[string]DownloadableFile, error)
- func (s *SimpleStreams) GetImage(fingerprint string) (*api.Image, error)
- func (s *SimpleStreams) ListAliases() ([]api.ImageAliasesEntry, error)
- func (s *SimpleStreams) ListImages() ([]api.Image, error)
- func (s *SimpleStreams) SetCache(path string, expiry time.Duration)
- type Stream
- type StreamIndex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DownloadableFile ¶
DownloadableFile represents a file with its URL, hash and size.
type Product ¶
type Product struct { Aliases string `json:"aliases"` Architecture string `json:"arch"` OperatingSystem string `json:"os"` Requirements map[string]string `json:"requirements,omitempty"` Release string `json:"release"` ReleaseCodename string `json:"release_codename,omitempty"` ReleaseTitle string `json:"release_title"` Supported bool `json:"supported,omitempty"` SupportedEOL string `json:"support_eol,omitempty"` Version string `json:"version,omitempty"` Versions map[string]ProductVersion `json:"versions"` // Non-standard fields (only used on some image servers). Variant string `json:"variant,omitempty"` }
Product represents a single product inside download.json.
type ProductVersion ¶
type ProductVersion struct { Items map[string]ProductVersionItem `json:"items"` Label string `json:"label,omitempty"` PublicName string `json:"pubname,omitempty"` }
ProductVersion represents a particular version of a product.
type ProductVersionItem ¶
type ProductVersionItem struct { CombinedSha256DiskImg string `json:"combined_disk1-img_sha256,omitempty"` CombinedSha256DiskKvmImg string `json:"combined_disk-kvm-img_sha256,omitempty"` CombinedSha256DiskUefiImg string `json:"combined_uefi1-img_sha256,omitempty"` CombinedSha256RootXz string `json:"combined_rootxz_sha256,omitempty"` CombinedSha256 string `json:"combined_sha256,omitempty"` CombinedSha256SquashFs string `json:"combined_squashfs_sha256,omitempty"` FileType string `json:"ftype"` HashMd5 string `json:"md5,omitempty"` Path string `json:"path"` HashSha256 string `json:"sha256,omitempty"` Size int64 `json:"size"` DeltaBase string `json:"delta_base,omitempty"` }
ProductVersionItem represents a file/item of a particular ProductVersion.
type Products ¶
type Products struct { ContentID string `json:"content_id"` DataType string `json:"datatype"` Format string `json:"format"` License string `json:"license,omitempty"` Products map[string]Product `json:"products"` Updated string `json:"updated,omitempty"` }
Products represents the base of download.json.
type SimpleStreams ¶
type SimpleStreams struct {
// contains filtered or unexported fields
}
SimpleStreams represents a simplestream client.
func NewClient ¶
func NewClient(url string, httpClient http.Client, useragent string) *SimpleStreams
NewClient returns a simplestreams client for the provided stream URL.
func NewLocalClient ¶
func NewLocalClient(path string) *SimpleStreams
NewLocalClient returns a simplestreams client for a local filesystem path.
func (*SimpleStreams) GetAlias ¶
func (s *SimpleStreams) GetAlias(imageType string, name string) (*api.ImageAliasesEntry, error)
GetAlias returns an ImageAliasesEntry for the provided alias name.
func (*SimpleStreams) GetAliasArchitectures ¶
func (s *SimpleStreams) GetAliasArchitectures(imageType string, name string) (map[string]*api.ImageAliasesEntry, error)
GetAliasArchitectures returns a map of architecture / alias entries for an alias.
func (*SimpleStreams) GetFiles ¶
func (s *SimpleStreams) GetFiles(fingerprint string) (map[string]DownloadableFile, error)
GetFiles returns a map of files for the provided image fingerprint.
func (*SimpleStreams) GetImage ¶
func (s *SimpleStreams) GetImage(fingerprint string) (*api.Image, error)
GetImage returns an image for the provided image fingerprint.
func (*SimpleStreams) ListAliases ¶
func (s *SimpleStreams) ListAliases() ([]api.ImageAliasesEntry, error)
ListAliases returns a list of image aliases for the provided image fingerprint.
func (*SimpleStreams) ListImages ¶
func (s *SimpleStreams) ListImages() ([]api.Image, error)
ListImages returns a list of images.