config

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSubscriptionEnabled

func IsSubscriptionEnabled() bool

IsSubscriptionEnabled returns true if subscription features are enabled

func ResetForTesting

func ResetForTesting()

ResetForTesting resets the global config - used only in tests

func ValidateEnvironmentConfig

func ValidateEnvironmentConfig() error

ValidateEnvironmentConfig validates that all environment variables are properly configured Set strict=false for local development, strict=true for production validation

func ValidateEnvironmentConfigStrict

func ValidateEnvironmentConfigStrict(strict bool) error

ValidateEnvironmentConfigStrict validates with optional strict mode

func WarnAboutUnhandledEnvVars

func WarnAboutUnhandledEnvVars()

WarnAboutUnhandledEnvVars checks for potentially unhandled environment variables

Types

type Config

type Config struct {
	// Feature flags
	SubscriptionEnabled bool

	// Database
	DatabasePath string

	// OAuth
	GoogleClientID     string
	GoogleClientSecret string
	GoogleRedirectURL  string

	// Stripe (only used if subscription is enabled)
	StripeSecretKey      string
	StripePublishableKey string
	StripeWebhookSecret  string

	// Admin initialization
	InitialAdminEmails []string

	// Server
	Port string

	// Feed Rate Limiting
	RateLimitRequestsPerMinute int           // Requests per minute per domain
	RateLimitBurstSize         int           // Burst allowance per domain
	SchedulerUpdateWindow      time.Duration // Time window to spread updates across
	SchedulerMinInterval       time.Duration // Minimum time between updates for same feed
	SchedulerMaxConcurrent     int           // Maximum concurrent feed updates
	SchedulerCleanupInterval   time.Duration // How often to cleanup old rate limiters
}

Config holds application configuration

func Get

func Get() *Config

Get returns the current configuration

func Load

func Load() *Config

Load loads configuration from environment variables

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL