Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PingPostgres ¶ added in v0.1.1
PingPostgres verifies connectivity to Postgres and optionally sets search_path for the session. It fails if the schema (when provided) does not exist.
Types ¶
type Option ¶ added in v0.1.7
type Option func(*ServerConfig) error
Option applies configuration to a ServerConfig instance.
type ServerConfig ¶
type ServerConfig struct {
Port string
Environment string // development, production, testing
// Database configuration
DatabaseURL string
DatabaseType string // "memory", "postgres"
DBSchema string // Postgres schema to use (default: content)
// Storage configuration
DefaultStorageBackend string
StorageBackends []StorageBackendConfig
// Server options
EnableEventLogging bool
EnablePreviews bool
EnableAdminAPI bool // Enable admin API endpoints (requires authentication in production)
// URL generation
URLStrategy string // "cdn", "content-based", "storage-delegated"
CDNBaseURL string // Base URL for CDN strategy downloads (e.g., "https://cdn.example.com")
UploadBaseURL string // Base URL for CDN strategy uploads (e.g., "https://api.example.com" or "/api/v1")
APIBaseURL string // Base URL for content-based strategy (e.g., "/api/v1")
// Object key generation
ObjectKeyGenerator string // "default", "git-like", "tenant-aware", "legacy"
}
ServerConfig represents server configuration for the simple-content service
func Load ¶ added in v0.1.7
func Load(opts ...Option) (*ServerConfig, error)
Load constructs a ServerConfig by applying the supplied options on top of library defaults.
func LoadServerConfig ¶
func LoadServerConfig() (*ServerConfig, error)
LoadServerConfig is a convenience function that loads configuration from environment variables. It applies the default config and then overlays environment variable settings.
func (*ServerConfig) BuildRepository ¶ added in v0.1.15
func (c *ServerConfig) BuildRepository() (simplecontent.Repository, error)
BuildService creates a Service instance from the server configuration BuildRepository builds just the repository from configuration
func (*ServerConfig) BuildService ¶
func (c *ServerConfig) BuildService() (simplecontent.Service, error)
func (*ServerConfig) Validate ¶
func (c *ServerConfig) Validate() error
Validate validates the server configuration
type StorageBackendConfig ¶
type StorageBackendConfig struct {
Name string
Type string // "memory", "fs", "s3"
Config map[string]interface{}
}
StorageBackendConfig represents configuration for a storage backend