Help us shape the future of Go! Take the 2026 Go Developer Survey

compose

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate404HTML

func Generate404HTML(stagingPath string) error

Generate404HTML creates a minimal 404.html file at the root of the staging directory. This prevents Cloudflare Pages from treating the site as a Single Page Application, which would interfere with _redirects functionality.

func GenerateInstallScript

func GenerateInstallScript(opts InstallScriptOptions) (string, error)

GenerateInstallScript generates a bash script for installing the repository

func GenerateKeyringName

func GenerateKeyringName(baseURL string) string

GenerateKeyringName creates a keyring filename from base URL Format: <sanitized-domain>

Types

type Apt

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

Apt composes Debian repository structure from trusted files

func NewApt

func NewApt(options *AptComposeOptions, verifier *debext.Verifier, signer pgp.Signer, decompressor *common.DeCompressor, pool pond.Pool) *Apt

NewApt creates a new Apt composer

func (*Apt) Compose

func (a *Apt) Compose(ctx context.Context) (*debext.Repository, error)

Compose generates the apt repository structure and returns the repository object

type AptComposeOptions

type AptComposeOptions struct {
	ComposeOptions

	// Repository contains the repository configuration
	Repository *common.RepositoryOptions

	// Trusted is the path to the trusted directory containing verified packages
	Trusted string

	// Cache is the path to the cache directory for parsed file data
	Cache string

	// PoolMode is the pool organization mode: "hierarchical" or "redirect"
	PoolMode string
}

AptComposeOptions contains configuration for APT repository composition

type ComposeOptions

type ComposeOptions struct {
	// Target is the path to the output directory
	Target string

	// Name is the repository name
	Name string

	// Feeds contains feed information
	Feeds []*feed.FeedOptions
}

ComposeOptions contains common configuration shared by all composers

type DirectoryEntry

type DirectoryEntry struct {
	Name        string
	URL         string
	IsDirectory bool
	Size        string
	Modified    string
}

DirectoryEntry represents a file or directory in the listing

type DirectoryListingData

type DirectoryListingData struct {
	CurrentPath string
	ParentPath  string
	Entries     []DirectoryEntry
	AssetsPath  string
	PageTitle   string
}

DirectoryListingData contains data for a directory browsing page

type FeedDetail added in v0.0.7

type FeedDetail struct {
	Text    string // Detail text to display
	Hover   string // Optional tooltip text (empty if no tooltip)
	Warning bool   // Whether to show a warning icon
}

FeedInfo contains information about a feed for template rendering

type FeedInfo

type FeedInfo struct {
	Type      feed.FeedType // Feed type (GitHub, APT, OBS)
	Name      string        // Feed name
	Subtitle  string        // Subtitle
	URL       string        // URL to the feed source
	Icon      string        // Icon filename without extension
	Details   []FeedDetail  // Formatted details to display (distributions, filters, etc.)
	NoChanges bool          // Whether this feed uses no_changes mode (no signature verification)
}

type IndexData

type IndexData struct {
	Repositories []RepositoryLink
	AssetsPath   string // Relative path to assets directory
	PageTitle    string // Title for the navigation bar
}

IndexData contains data for the root index page

type InstallScriptOptions

type InstallScriptOptions struct {
	RepoName      string   // Repository name
	BaseURL       string   // Base URL for the repository
	Distributions []string // Available distributions
	KeyringName   string   // Keyring filename (sanitized domain)
}

InstallScriptOptions contains options for generating an install script

type PackageTableConfig

type PackageTableConfig struct {
	ID               string   // HTML element ID
	Distributions    []string // List of distributions to display
	ArchitectureMode string   // "multi" for multiple architectures, "source" for source only
	Component        string   // Component name
}

PackageTableConfig defines the configuration for rendering a package table

type PreparedPackageTable

type PreparedPackageTable struct {
	ID           string
	DistHeaders  []TableHeaderColumn // First header row (distributions)
	ArchHeaders  []TableHeaderColumn // Second header row (architectures), empty for source mode
	Rows         []TableRow
	HasArchRow   bool   // Whether to show the architecture row
	IsEmpty      bool   // Whether the table has no packages
	EmptyMessage string // Message to show when empty
}

PreparedPackageTable contains all the pre-computed data for rendering a table

type RepositoryInfo

type RepositoryInfo struct {
	Name          string
	Component     string
	Distributions []string
	Feeds         []FeedInfo
}

RepositoryInfo contains information about a repository for template rendering

type RepositoryLink struct {
	Name string
	Path string // Relative path to repository HTML file
}

RepositoryLink contains minimal info for linking to a repository

type RepositoryPageData

type RepositoryPageData struct {
	ComposeOptions    *ComposeOptions
	RepositoryOptions *common.RepositoryOptions
	DescriptionHTML   template.HTML // Rendered markdown description
	BaseURL           string        // Base URL for the repository
	Repository        *debext.Repository
	AssetsPath        string                 // Relative path to assets directory
	Tables            []PreparedPackageTable // Pre-computed package tables
	Feeds             []FeedInfo             // Feed display info with icons
	PageTitle         string                 // Title for the navigation bar
	KeyringName       string                 // Keyring filename (sanitized domain)
	RepositoryIcon    string                 // Repository icon filename (without extension) or empty for letter box
}

RepositoryPageData contains data for a repository detail page

type TableCell

type TableCell struct {
	Version      string // Full version string
	ShortVersion string // Version without distribution suffix
	IsNewest     bool   // Whether this is the newest version
	HasPackage   bool   // Whether a package exists for this cell
}

TableCell represents a single cell in the table body

type TableHeaderColumn

type TableHeaderColumn struct {
	Name    string // Display name (distribution or architecture)
	Colspan int    // Number of columns this header spans (for distribution headers)
}

TableHeaderColumn represents a column in the table header

type TableRow

type TableRow struct {
	PackageName string
	Cells       []TableCell
}

TableRow represents a row in the table body

type TailwindCLI

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

TailwindCLI manages the Tailwind CSS CLI binary

func NewTailwindCLI

func NewTailwindCLI(downloader *common.Downloader, githubClient *github.Client, assetsDir string, release string) *TailwindCLI

NewTailwindCLI creates a new Tailwind CLI manager Downloads and caches the Tailwind binary in the assets directory If release is empty, uses the latest release

func (*TailwindCLI) Build

func (t *TailwindCLI) Build(ctx context.Context, inputCSS, outputCSS, cwd string) error

Build runs the Tailwind CLI to generate CSS from input file Tailwind v4 automatically scans files based on @source directives in the input CSS

type Web

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

Web generates static HTML pages for repository browsing

func NewWeb

func NewWeb(options *WebComposeOptions, downloader *common.Downloader) (*Web, error)

NewWeb creates a new web composer

func (*Web) BuildTailwindCSS

func (w *Web) BuildTailwindCSS(ctx context.Context) error

BuildTailwindCSS builds optimized CSS from templates using Tailwind CLI This should be called after all HTML files have been generated

func (*Web) Compose

func (w *Web) Compose(ctx context.Context, repo *debext.Repository) error

Compose generates the static HTML page for a single repository

func (*Web) GenerateDirectoryIndexes

func (w *Web) GenerateDirectoryIndexes(ctx context.Context, repoName string) error

GenerateDirectoryIndexes creates browsable index.html files for dists/ and subdirectories

func (*Web) Index

func (w *Web) Index(ctx context.Context) error

Index scans for repository subdirectories and generates the root index.html

type WebComposeOptions

type WebComposeOptions struct {
	ComposeOptions

	// Description is a markdown-formatted description of the repository
	Description string

	// Repository contains the repository configuration
	Repository *common.RepositoryOptions

	// BaseURL is the base URL where the repository will be served
	BaseURL string

	// Downloads is the root downloads directory for caching assets
	Downloads string

	// PrimaryPackage is the primary package name used for distribution sorting
	PrimaryPackage string

	// IconURLs maps feed type names to their icon SVG URLs
	IconURLs map[string]string

	// GitHubClient is the GitHub API client for fetching releases
	GitHubClient *github.Client

	// TailwindRelease is the specific Tailwind CSS release to use (empty = latest)
	TailwindRelease string

	// RepositoryConfig is the original repository configuration (used for YAML export)
	RepositoryConfig any
}

WebComposeOptions contains configuration for web page generation

Jump to

Keyboard shortcuts

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