Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SaveConfig ¶
SaveConfig saves configuration to a file
Types ¶
type ClientConfig ¶
type ClientConfig struct {
ServerURL string `json:"server_url"` // Server URL (e.g., "http://95.145.216.175")
ChunkSize int `json:"chunk_size"` // Chunk size in bytes
Token string `json:"token"` // Authentication token (optional)
}
ClientConfig holds client configuration
func DefaultClientConfig ¶
func DefaultClientConfig() ClientConfig
DefaultClientConfig returns default client configuration
type Config ¶
type Config struct {
Server ServerConfig `json:"server"`
Client ClientConfig `json:"client"`
}
Config holds both server and client configuration
func LoadConfig ¶
LoadConfig loads configuration from a file
func LoadOrCreateConfig ¶
LoadOrCreateConfig loads config from file, or creates default if not exists
type ServerConfig ¶
type ServerConfig struct {
Address string `json:"address"` // Listen address (e.g., "0.0.0.0:80")
StorageDir string `json:"storage_dir"` // Storage directory path
MetaDir string `json:"meta_dir"` // Metadata directory for resume
TokensFile string `json:"tokens_file"` // Path to tokens file (empty to disable auth)
TLSCertFile string `json:"tls_cert"` // TLS certificate file (empty for HTTP)
TLSKeyFile string `json:"tls_key"` // TLS key file (empty for HTTP)
}
ServerConfig holds server configuration
func DefaultServerConfig ¶
func DefaultServerConfig() ServerConfig
DefaultServerConfig returns default server configuration
Click to show internal directories.
Click to hide internal directories.