feed

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeGithubFilename

func NormalizeGithubFilename(name string) string

NormalizeGithubFilename converts Debian filename to GitHub's normalized form GitHub replaces special chars with dots, keeps alphanumeric, underscore, hyphen, dot

func ParseGitHubDigest

func ParseGitHubDigest(digest string) (string, string)

ParseGitHubDigest parses GitHub asset digest into algorithm and hash Returns algorithm (e.g., "sha256") and hex hash, or empty strings if digest is empty/invalid

Types

type Apt

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

Apt handles APT repository downloads

func NewApt

func NewApt(storage *common.Storage, verifier *debext.Verifier, options *FeedOptions, repository *common.RepositoryOptions, pool pond.Pool) (*Apt, error)

NewApt creates a single APT feed instance. Feed expansion should be done at the app level before calling this.

func (*Apt) Run

func (s *Apt) Run(ctx context.Context) error

Run executes the complete download and verification process

type DistributionMap

type DistributionMap struct {
	Feed   string // Distribution name in the feed (e.g., "/" for flat repos, "Debian_13", "noble")
	Target string // Distribution name in our repository (e.g., "noble", "trixie")
}

DistributionMap represents a mapping from a feed's distribution name to the target repository distribution name. After config resolution, both Feed and Target are always set (identity mapping if no rename specified).

func (DistributionMap) MarshalYAML

func (d DistributionMap) MarshalYAML() (any, error)

MarshalYAML implements custom marshaling for DistributionMap: - If Target is empty or equals Feed: output as string "noble" - If Feed != Target: output as map {"focal": "stable"}

func (*DistributionMap) UnmarshalYAML

func (d *DistributionMap) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements custom unmarshaling for DistributionMap to support both formats: - String: "noble" -> {Feed: "noble", Target: ""} (Target auto-mapped by expansion) - Map: {"focal": "stable"} -> {Feed: "focal", Target: "stable"}

type Feed

type Feed interface {
	// Run executes the complete download and verification process
	Run(ctx context.Context) error
}

Feed represents any download source type

type FeedOptions

type FeedOptions struct {
	// Feed type: github, apt, obs
	Type FeedType

	// Name identifies the feed source as configured. Format depends on feed type:
	// - GitHub: "owner/repo"
	// - APT: base URL without scheme (e.g., "deb.debext.org/debian")
	// - OBS: project identifier (e.g., "home:dionysius:immich")
	Name string

	// Derived URLs and paths (calculated during unmarshal)
	ProjectURL   *url.URL // URL to the project page (e.g., GitHub repo, OBS project)
	DownloadURL  *url.URL // Base URL for downloads (with https://)
	RelativePath string   // Relative path for downloads and trusted directory

	// GitHub-specific
	Releases  []ReleaseType // Release types to include
	Tags      []string      // Tag name filters (glob patterns, ! prefix for negation)
	NoChanges bool          // Skip .changes files and directly download package files (requires dist mapping)

	// Common to all feeds
	Distributions []DistributionMap // Distribution mappings from feed to target repository

	// Package source filtering - which packages to include
	FromSources []string // Source name patterns (glob, ! for negation), empty = include all

	// Package name filtering - which packages to include
	Packages []string // Package name patterns (glob, ! for negation), empty = include all
}

FeedOptions contains fully-resolved configuration for a feed source. All values are already inherited/merged from repository-level config.

func ExpandAptFeedOptions added in v0.0.7

func ExpandAptFeedOptions(options *FeedOptions) []*FeedOptions

ExpandAptFeedOptions expands a single APT FeedOptions with prefix mappings into multiple FeedOptions, one per distribution.

func ExpandOBSFeedOptions added in v0.0.7

func ExpandOBSFeedOptions(options *FeedOptions) []*FeedOptions

ExpandOBSFeedOptions expands an OBS FeedOptions into flat APT FeedOptions, one per distribution. OBS distributions are converted to APT prefix notation where each OBS dist becomes a prefix with a flat repo (/).

func (FeedOptions) MarshalYAML

func (f FeedOptions) MarshalYAML() (any, error)

MarshalYAML implements custom marshaling for FeedOptions to output feed type fields implicitly.

func (*FeedOptions) UnmarshalYAML

func (f *FeedOptions) UnmarshalYAML(node *yaml.Node) (err error)

UnmarshalYAML implements custom unmarshaling for FeedOptions to handle feed type fields implicitly. Detects feed type from github/apt/obs fields and sets Type and Location accordingly.

type FeedType

type FeedType string

FeedType represents the type of feed source

const (
	FeedTypeGitHub  FeedType = "github"
	FeedTypeAPT     FeedType = "apt"
	FeedTypeOBS     FeedType = "obs"
	FeedTypeUnknown FeedType = "unknown"
)

Feed type constants

func (FeedType) String

func (f FeedType) String() string

type Github

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

Github handles github release downloads

func NewGithub

func NewGithub(storage *common.Storage, client *github.Client, verifier *debext.Verifier, options *FeedOptions, repository *common.RepositoryOptions, pool pond.Pool) (*Github, error)

NewGithub creates a new Github feed.

func (*Github) Run

func (s *Github) Run(ctx context.Context) error

Run executes the complete download and verification process

type ReleaseType

type ReleaseType string

ReleaseType represents a GitHub release type

const (
	ReleaseTypeRelease    ReleaseType = "release"     // Normal release (not draft, not prerelease)
	ReleaseTypePrerelease ReleaseType = "pre-release" // Pre-release
	ReleaseTypeDraft      ReleaseType = "draft"       // Draft release
)

Release type constants for GitHub feeds

Jump to

Keyboard shortcuts

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