package config import ( "github.com/joho/godotenv" "os" ) type Config struct { TencentSecretID string TencentSecretKey string GeminiAPIKey string APIKey string R2AccessKey string R2SecretKey string R2Bucket string R2Endpoint string R2CustomDomain string } func LoadConfig() (*Config, error) { if err := godotenv.Load(); err != nil { return nil, err } return &Config{ TencentSecretID: os.Getenv("TENCENT_SECRET_ID"), TencentSecretKey: os.Getenv("TENCENT_SECRET_KEY"), GeminiAPIKey: os.Getenv("GEMINI_API_KEY"), APIKey: os.Getenv("API_KEY"), R2AccessKey: os.Getenv("R2_ACCESS_KEY"), R2SecretKey: os.Getenv("R2_SECRET_KEY"), R2Bucket: os.Getenv("R2_BUCKET"), R2Endpoint: os.Getenv("R2_ENDPOINT"), R2CustomDomain: os.Getenv("R2_CUSTOM_DOMAIN"), }, nil }