Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Version is set during build time Version string )
Functions ¶
func Daemon ¶
func Daemon(flags *Config)
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 ¶ added in v0.6.0
ValidateConfig performs validation on the configuration to ensure all required fields are set and valid. Returns an error if validation fails.
Types ¶
type Config ¶ added in v0.6.0
type Config struct {
Debug bool
Version string
CacheDir string
Mode int
Listen string
Mirrors MirrorConfig
}
Config holds all application configuration
func ParseFlags ¶
ParseFlags parses command-line flags and returns a Config struct with all application settings. It validates the mode parameter and sets up global state. Returns an error if flag parsing fails or if an invalid mode is specified.
type MirrorConfig ¶ added in v0.6.0
type MirrorConfig struct {
Ubuntu string
UbuntuPorts string
Debian string
CentOS string
Alpine string
}
MirrorConfig holds mirror-specific configuration
type Server ¶ added in v0.6.0
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 ¶ added in v0.6.0
NewServer creates and initializes a new Server instance with the provided configuration. It sets up caching, proxy routing, logging, and HTTP server. Returns an error if initialization fails.