Initial commit: ozon-mock Go server
- Mock Ozon Seller API endpoints - Products, Postings, Finance, Returns, Analytics - JSON fixtures for testing - Docker support - Gitea Actions CI/CD
This commit is contained in:
24
internal/config/config.go
Normal file
24
internal/config/config.go
Normal file
@ -0,0 +1,24 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user