treasurer/internal/models/config.go

46 lines
1.1 KiB
Go
Raw Normal View History

2023-06-13 13:22:51 +00:00
package models
import (
2024-12-16 13:47:40 +00:00
"gitea.pena/PenaSide/treasurer/pkg/mongo"
2023-06-13 13:22:51 +00:00
)
type Config struct {
HTTP ConfigurationHTTP
GRPC ConfigurationGRPC
Service ServiceConfiguration
Database mongo.Configuration
}
type ConfigurationHTTP struct {
Host string `env:"HTTP_HOST,default=localhost"`
Port string `env:"HTTP_PORT,default=8080"`
Domen string `env:"HTTP_DOMEN,required"`
}
type ConfigurationGRPC struct {
Host string `env:"GRPC_HOST,default=0.0.0.0"`
Port string `env:"GRPC_PORT,default=8081"`
}
type ServiceConfiguration struct {
YoomomeyConfiguration YoomomeyConfiguration
2023-06-19 19:39:34 +00:00
MockConfiguration MockConfiguration
}
type MockConfiguration struct {
IsMock bool `env:"IS_MOCK,default=false"`
Host string `env:"MOCK_SERVICE_HOST,default=http://localhost:8080"`
YoomomeyURL YoomomeyURL
2023-06-13 13:22:51 +00:00
}
type YoomomeyConfiguration struct {
StoreID string `env:"YOOMONEY_STORE_ID,required"`
SecretKey string `env:"YOOMONEY_SECRET_KEY,required"`
2023-06-19 19:39:34 +00:00
URL YoomomeyURL
}
type YoomomeyURL struct {
Webhooks string `env:"YOOMONEY_WEBHOOKS_URL,required"`
Payments string `env:"YOOMONEY_PAYMENTS_URL,required"`
2023-06-13 13:22:51 +00:00
}