How osnieltux/tinyrepo works
Project type and purpose
• tinyrepo is a single‐binary, command‐line Go application meant to create and manage small local APT repositories for Debian derivatives. It is not a web service or full-stack app, but rather a CLI tool with modular internal components and a few external dependencies (TOML parser, XZ decompressor, remote HTTP servers, local filesystem).
File structure
• Top-level Go files:
• main.go – CLI entrypoint, flag parsing, dispatch to subcommands
• config.go – definition of configuration struct, loading/saving via BurntSushi/toml
• global.go – global constants, paths, shared variables (e.g., cache location, repo root)
• package.go – logic for downloading and indexing .deb packages, generating Packages files
• utils.go – helper functions (HTTP download, decompression, file operations)
• go.mod & go.sum declare external dependencies.
• No frontend, database server, or network services beyond invoking HTTP clients.
README for additional insights
• Describes four main CLI actions: generate config (-gc), download indexes (-di), create local indexes (-ci), download packages (-dp).
• External interactions: reads remote “Indexes” over HTTP, decompresses .xz, writes local index files, downloads .deb packages.
Essential architectural elements
• Boundary between internal logic and external dependencies (remote servers, libraries)