lxd: github.com/lxc/lxd/shared/simplestreams Index | Files

package simplestreams

import "github.com/lxc/lxd/shared/simplestreams"

Index

Package Files

index.go products.go simplestreams.go sort.go

type DownloadableFile Uses

type DownloadableFile struct {
    Path   string
    Sha256 string
    Size   int64
}

DownloadableFile represents a file with its URL, hash and size

type Product Uses

type Product struct {
    Aliases         string                    `json:"aliases"`
    Architecture    string                    `json:"arch"`
    OperatingSystem string                    `json:"os"`
    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"`
}

Product represents a single product inside download.json

type ProductVersion Uses

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 Uses

type ProductVersionItem struct {
    LXDHashSha256DiskImg  string `json:"combined_disk1-img_sha256,omitempty"`
    LXDHashSha256RootXz   string `json:"combined_rootxz_sha256,omitempty"`
    LXDHashSha256         string `json:"combined_sha256,omitempty"`
    LXDHashSha256SquashFs 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 Uses

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

func (*Products) ToLXD Uses

func (s *Products) ToLXD() ([]api.Image, map[string][][]string)

ToLXD converts the products data into a list of LXD images and associated downloadable files

type SimpleStreams Uses

type SimpleStreams struct {
    // contains filtered or unexported fields
}

SimpleStreams represents a simplestream client

func NewClient Uses

func NewClient(url string, httpClient http.Client, useragent string) *SimpleStreams

NewClient returns a simplestreams client for the provided stream URL

func (*SimpleStreams) GetAlias Uses

func (s *SimpleStreams) GetAlias(imageType string, name string) (*api.ImageAliasesEntry, error)

GetAlias returns a LXD ImageAliasesEntry for the provided alias name

func (*SimpleStreams) GetFiles Uses

func (s *SimpleStreams) GetFiles(fingerprint string) (map[string]DownloadableFile, error)

GetFiles returns a map of files for the provided image fingerprint

func (*SimpleStreams) GetImage Uses

func (s *SimpleStreams) GetImage(fingerprint string) (*api.Image, error)

GetImage returns a LXD image for the provided image fingerprint

func (*SimpleStreams) ListAliases Uses

func (s *SimpleStreams) ListAliases() ([]api.ImageAliasesEntry, error)

ListAliases returns a list of image aliases for the provided image fingerprint

func (*SimpleStreams) ListImages Uses

func (s *SimpleStreams) ListImages() ([]api.Image, error)

ListImages returns a list of LXD images

type Stream Uses

type Stream struct {
    Index   map[string]StreamIndex `json:"index"`
    Updated string                 `json:"updated,omitempty"`
    Format  string                 `json:"format"`
}

Stream represents the base structure of index.json

type StreamIndex Uses

type StreamIndex struct {
    DataType string   `json:"datatype"`
    Path     string   `json:"path"`
    Updated  string   `json:"updated,omitempty"`
    Products []string `json:"products"`
    Format   string   `json:"format,omitempty"`
}

StreamIndex represents the Index entry inside index.json

Package simplestreams imports 11 packages (graph) and is imported by 9 packages. Updated 2019-09-26. Refresh now. Tools for package owners.