- Mock Ozon Seller API endpoints - Products, Postings, Finance, Returns, Analytics - JSON fixtures for testing - Docker support - Gitea Actions CI/CD
25 lines
386 B
Go
25 lines
386 B
Go
package config
|
|
|
|
import "os"
|
|
|
|
type Config struct {
|
|
Port string
|
|
ClientID string
|
|
APIKey string
|
|
}
|
|
|
|
func Load() *Config {
|
|
return &Config{
|
|
Port: getEnv("PORT", "8080"),
|
|
ClientID: os.Getenv("OZON_CLIENT_ID"),
|
|
APIKey: os.Getenv("OZON_API_KEY"),
|
|
}
|
|
}
|
|
|
|
func getEnv(key, defaultVal string) string {
|
|
if val := os.Getenv(key); val != "" {
|
|
return val
|
|
}
|
|
return defaultVal
|
|
}
|