Documentation ¶
Index ¶
- Constants
- Variables
- func LoadImageMeta(url string) (lxdApi.ImageMetadata, string, error)
- func LoadSHA256(url string) (string, error)
- func ProductID(image TagImage, arch string) string
- type SimpleStreams
- func (s *SimpleStreams) GenerateImages(ctx context.Context, owner, repo string) (ss.Products, error)
- func (s *SimpleStreams) GenerateStream(ctx context.Context, owner, repo string) (ss.Stream, error)
- func (s *SimpleStreams) GetPathURL(ctx context.Context, owner, repo, name, arch, version, file string) (string, error)
- type TagImage
Constants ¶
View Source
const PathPattern = "/images/{name}/{arch}/v{version}/{file}"
PathPattern represents a mux.Router pattern for file paths
Variables ¶
View Source
var ( // ErrInvalidTag indicates a tag isn't a valid image + version combo ErrInvalidTag = errors.New("invalid tag format") // ErrMetadataMissing indicates the metadata.yaml file is missing ErrMetadataMissing = errors.New("metadata.yaml missing from lxd.tar.xz") // ErrIncompleteRelease indicates a release is missing key assets ErrIncompleteRelease = errors.New("release is missing required assets") // ErrInvalidPath indicates an image path is not valid ErrInvalidPath = errors.New("invalid image file path") )
Functions ¶
func LoadImageMeta ¶
func LoadImageMeta(url string) (lxdApi.ImageMetadata, string, error)
LoadImageMeta downloads an lxd.tar.xz file and parses the metadata.yaml file within
func LoadSHA256 ¶
LoadSHA256 downloads a SHA256 hash from a URL (file in the format used by the `sha256sum` command)
Types ¶
type SimpleStreams ¶
type SimpleStreams struct {
// contains filtered or unexported fields
}
SimpleStreams represents a proxy which speaks simplestreams for a GitHub repo's releases
func NewSimpleStreams ¶
func NewSimpleStreams() *SimpleStreams
NewSimpleStreams creates a new simplestreams proxy
func (*SimpleStreams) GenerateImages ¶
func (s *SimpleStreams) GenerateImages(ctx context.Context, owner, repo string) (ss.Products, error)
GenerateImages generates an images stream from a GitHub repository
func (*SimpleStreams) GenerateStream ¶
GenerateStream generates a struct of the simplestreams index.json (for a given GitHub repo)
func (*SimpleStreams) GetPathURL ¶
func (s *SimpleStreams) GetPathURL(ctx context.Context, owner, repo, name, arch, version, file string) (string, error)
GetPathURL converts a path (generated by releaseToProducts) and returns the GitHub asset URL for the path
Click to show internal directories.
Click to hide internal directories.