flatpak

package
v0.270.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Flatpak only uses the static endpoint
	ENDPOINT_STATIC = "/index/static"
)

Variables

View Source
var ErrUnknownRegistryType = errors.New("unknown registry type")

Functions

func ResolveAll

func ResolveAll(sources map[string][]SourceSpec) (map[string][]Spec, error)

Types

type OCIRegistryIndex added in v0.265.0

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

OCIRegistryIndex is a session for querying one OCI registry's Flatpak static index (/index/static) for a fixed os/tag pair. The decoded JSON is cached on this instance until OCIRegistryIndex.Close. Callers should defer Close() once they are done issuing OCIRegistryIndex.Query calls.

Manifest and config resolution for the digest-pinned image is delegated to container.Resolver from pkg/container (container.NewBlockingResolver).

func NewOCIRegistryIndex added in v0.265.0

func NewOCIRegistryIndex(baseURI, os, tag string) (*OCIRegistryIndex, error)

NewOCIRegistryIndex constructs an index client for baseURI (https host or full origin without the oci+ scheme prefix), Flatpak index os and tag query parameters.

func (*OCIRegistryIndex) Close added in v0.265.0

func (q *OCIRegistryIndex) Close()

Close drops the cached decoded index. It must not be called concurrently with Query.

func (*OCIRegistryIndex) Query added in v0.265.0

func (q *OCIRegistryIndex) Query(flatpakRef string) (*container.Spec, error)

Query parses flatpakRef with NewReferenceFromString for architecture selection, loads the registry index (cached on this instance), finds the image by org.flatpak.ref, then resolves the digest-pinned image using container.NewBlockingResolver (pkg/container).

type Reference

type Reference struct {
	Type       string
	Identifier string
	Arch       string
	Branch     string
}

func NewReferenceFromString

func NewReferenceFromString(ref string) (Reference, error)

func (*Reference) String

func (r *Reference) String() string

type Registry

type Registry struct {
	RemoteName string
	Type       RegistryType
	URI        string
}

func NewRegistryFromURI

func NewRegistryFromURI(uri string) (*Registry, error)

func (*Registry) Query

func (r *Registry) Query(ref string) (*Spec, error)

type RegistryType

type RegistryType uint
const (
	REGISTRY_TYPE_UNKNOWN RegistryType = iota
	REGISTRY_TYPE_OCI
)

type ResponseImage

type ResponseImage struct {
	Tags         []string          `json:"Tags"`
	Digest       string            `json:"Digest"`
	MediaType    string            `json:"MediaType"`
	OS           string            `json:"OS"`
	Architecture string            `json:"Architecture"`
	Annotations  map[string]string `json:"Annotations"`
	Labels       map[string]string `json:"Labels"`
}

type ResponseImageList

type ResponseImageList struct{}

type ResponseRepository

type ResponseRepository struct {
	Name   string              `json:"Name"`
	Images []*ResponseImage    `json:"Images"`
	Lists  []ResponseImageList `json:"Lists"`
}

type ResponseRoot

type ResponseRoot struct {
	Registry string               `json:"Registry"`
	Results  []ResponseRepository `json:"Results"`
}

type SourceSpec

type SourceSpec struct {
	Registry  Registry
	Reference Reference
}

type Spec

type Spec struct {
	ContainerSpec *container.Spec
	CommitSpec    *ostree.CommitSpec
}

A flatpak source can return (based on the type of the registry in the `SourceSpec`) either a container or an ostree commit.

func Resolve

func Resolve(source SourceSpec) (Spec, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL