Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRoutesWithAuth ¶
func RegisterRoutesWithAuth(e *echo.Echo, cfg *Config, authMiddleware *auth.Middleware)
RegisterRoutesWithAuth registers config routes with authentication.
Types ¶
type Config ¶
type Config struct {
// Database settings
DatabaseConnectRetryCount int `koanf:"database_connect_retry_count" json:"database_connect_retry_count"`
DatabaseConnectRetryDelay time.Duration `koanf:"database_connect_retry_delay" json:"database_connect_retry_delay"`
DatabaseDebug bool `koanf:"database_debug" json:"database_debug"`
DatabaseFilePath string `koanf:"database_file_path" json:"database_file_path" validate:"required"`
DatabaseBusyTimeout time.Duration `koanf:"database_busy_timeout" json:"database_busy_timeout"`
DatabaseMaxRetries int `koanf:"database_max_retries" json:"database_max_retries"`
// Server settings
ServerHost string `koanf:"server_host" json:"server_host"`
ServerPort int `koanf:"server_port" json:"server_port"`
// Application settings
SyncIntervalMinutes int `koanf:"sync_interval_minutes" json:"sync_interval_minutes"`
WorkerProcesses int `koanf:"worker_processes" json:"worker_processes"`
// Job retention settings
JobRetentionDays int `koanf:"job_retention_days" json:"job_retention_days"`
// Cache settings
CacheDir string `koanf:"cache_dir" json:"cache_dir"`
DownloadCacheMaxSizeGB int `koanf:"download_cache_max_size_gb" json:"download_cache_max_size_gb"`
// Plugin settings
PluginDir string `koanf:"plugin_dir" json:"plugin_dir"`
// Supplement discovery settings
SupplementExcludePatterns []string `koanf:"supplement_exclude_patterns" json:"supplement_exclude_patterns"`
// Authentication settings
JWTSecret string `koanf:"jwt_secret" json:"-" validate:"required"` // Never expose in JSON
// Environment settings
// Set to "test" to enable test-only API endpoints (e.g., /test/users)
Environment string `koanf:"environment" json:"environment"`
// Internal settings (computed, not from config file)
Hostname string `koanf:"-" json:"-"`
}
Config holds all application configuration. Configure via YAML file (/config/shisho.yaml) or environment variables. Environment variables use uppercase with underscores (e.g., DATABASE_FILE_PATH).
func New ¶
New creates a new Config by loading from file and environment variables. Load order (later sources override earlier):
- Defaults
- Config file (/config/shisho.yaml or CONFIG_FILE env var)
- Environment variables (prefixed with SHISHO_)
func NewForTest ¶
func NewForTest() *Config
NewForTest creates a Config for testing with minimal required fields.
func (*Config) DownloadCacheMaxSizeBytes ¶
DownloadCacheMaxSizeBytes returns the maximum cache size in bytes.
func (*Config) IsTestMode ¶
IsTestMode returns true if the server is running in test mode.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) RetrieveConfig ¶
Click to show internal directories.
Click to hide internal directories.