Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct {
Env string `envconfig:"APP_ENV" default:"development"`
Scheme string `envconfig:"APP_SCHEME" default:"https"`
Host string `envconfig:"APP_HOST" default:"localhost"`
Port int `envconfig:"APP_PORT" default:"3000"`
DB DBConfig `envconfig:"DATABASE"`
Auth AuthConfig `envconfig:"AUTH"`
Jwt JwtConfig `envconfig:"JWT"`
Exchange ExchangeRateConfig `envconfig:"EXCHANGE_RATE"`
Redis RedisConfig `envconfig:"REDIS"`
RateLimit RateLimitConfig `envconfig:"RATE_LIMIT"`
PaymentProviders PaymentProviders `envconfig:"PAYMENT_PROVIDER"`
}
type AuthConfig ¶
type AuthConfig struct {
Strategy string `envconfig:"STRATEGY" default:"jwt"`
}
type Deps ¶
type Deps struct {
Uow repository.UnitOfWork
CurrencyConverter money.CurrencyConverter
CurrencyRegistry *currency.Registry
PaymentProvider provider.PaymentProvider
EventBus eventbus.Bus
Logger *slog.Logger
Config *AppConfig
}
Deps holds all infrastructure dependencies for building the app and services.
type ExchangeRateConfig ¶
type ExchangeRateConfig struct {
ApiKey string `envconfig:"API_KEY"`
ApiUrl string `envconfig:"API_URL" default:""`
CacheTTL time.Duration `envconfig:"CACHE_TTL" default:"15m"`
HTTPTimeout time.Duration `envconfig:"HTTP_TIMEOUT" default:"10s"`
MaxRetries int `envconfig:"MAX_RETRIES" default:"3"`
RequestsPerMinute int `envconfig:"REQUESTS_PER_MINUTE" default:"60"`
BurstSize int `envconfig:"BURST_SIZE" default:"10"`
EnableFallback bool `envconfig:"ENABLE_FALLBACK" default:"true"`
FallbackTTL time.Duration `envconfig:"FALLBACK_TTL" default:"1h"`
CachePrefix string `envconfig:"CACHE_PREFIX" default:"exr:rate:"`
CacheUrl string `envconfig:"CACHE_URL"`
}
type PaymentProviders ¶
type PaymentProviders struct {
Stripe Stripe `envconfig:"STRIPE"`
}
type RateLimitConfig ¶
type RedisConfig ¶
type RedisConfig struct {
URL string `envconfig:"URL" default:"redis://localhost:6379/0"`
KeyPrefix string `envconfig:"KEY_PREFIX" default:""`
PoolSize int `envconfig:"POOL_SIZE" default:"10"`
DialTimeout time.Duration `envconfig:"DIAL_TIMEOUT" default:"5s"`
ReadTimeout time.Duration `envconfig:"READ_TIMEOUT" default:"3s"`
WriteTimeout time.Duration `envconfig:"WRITE_TIMEOUT" default:"3s"`
}
type Stripe ¶
type Stripe struct {
ApiKey string `envconfig:"API_KEY"`
SigningSecret string `envconfig:"SIGNING_SECRET"`
SuccessPath string `envconfig:"SUCCESS_PATH" default:"http://localhost:3000/payment/stripe/success/"`
CancelPath string `envconfig:"CANCEL_PATH" default:"http://localhost:3000/payment/stripe/cancel/"`
}
Click to show internal directories.
Click to hide internal directories.