Documentation
¶
Overview ¶
Package cli provides the command-line interface for apt-proxy. It re-exports configuration types and parsing functions from internal/config for external use while maintaining the simplified cli.Daemon entry point.
Index ¶
Constants ¶
const ( EnvHost = config.EnvHost EnvPort = config.EnvPort EnvMode = config.EnvMode EnvCacheDir = config.EnvCacheDir EnvDebug = config.EnvDebug EnvUbuntu = config.EnvUbuntu EnvUbuntuPorts = config.EnvUbuntuPorts EnvDebian = config.EnvDebian EnvCentOS = config.EnvCentOS EnvAlpine = config.EnvAlpine EnvCacheMaxSize = config.EnvCacheMaxSize EnvCacheTTL = config.EnvCacheTTL EnvCacheCleanupInterval = config.EnvCacheCleanupInterval EnvTLSEnabled = config.EnvTLSEnabled EnvTLSCertFile = config.EnvTLSCertFile EnvTLSKeyFile = config.EnvTLSKeyFile DefaultHost = config.DefaultHost DefaultPort = config.DefaultPort DefaultCacheDir = config.DefaultCacheDir DefaultCacheMaxSizeGB = config.DefaultCacheMaxSizeGB DefaultCacheTTLHours = config.DefaultCacheTTLHours DefaultCacheCleanupIntervalMin = config.DefaultCacheCleanupIntervalMin )
Re-export constants from internal/config for backward compatibility
Variables ¶
This section is empty.
Functions ¶
func Daemon ¶
Daemon is the main entry point for starting the application daemon. It validates the configuration, creates and starts the server, and handles any startup errors. This function blocks until the server shuts down.
func ValidateConfig ¶
ValidateConfig validates the configuration. This is a wrapper around config.ValidateConfig for backward compatibility.
Types ¶
type CacheConfig ¶
type CacheConfig = config.CacheConfig
CacheConfig holds cache-specific configuration
type Config ¶
Config holds all application configuration
func ParseFlags ¶
ParseFlags parses command-line flags and returns a Config. This is a wrapper around config.ParseFlags for backward compatibility.
type MirrorConfig ¶
type MirrorConfig = config.MirrorConfig
MirrorConfig holds mirror-specific configuration
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the main application server that handles HTTP requests, manages caching, and coordinates all server components.
func NewServer ¶
NewServer creates and initializes a new Server instance with the provided configuration. It sets up caching, proxy routing, logging, and HTTP proxy. Returns an error if initialization fails.
func (*Server) Start ¶
Start begins serving HTTP requests and handles graceful shutdown on SIGINT or SIGTERM. It also handles SIGHUP for configuration hot reload. The server runs in a goroutine while the main goroutine waits for shutdown signals. Returns an error if the server fails to start or encounters a fatal error.