class ZipkinConfig(config.Config): host = config.StrField(default="localhost", env="ZIPKIN_HOST") port = config.IntField(default=9411, env="ZIPKIN_PORT") enabled = config.BoolField(default=False, env="ZIPKIN_ENABLED") def get_address(self) -> str: return f"http://{self.host}:{self.port}/api/v2/spans"
class AppConfig(config.Config): debug = config.BoolField(default=False) sentry_dsn = config.StrField(path="sentry-dsn", env="SENTRY_DSN") zipkin = config.NestedField[ZipkinConfig](ZipkinConfig)
class TelegramConfig(config.Config): chat = config.StrField(env="TELEGRAM_CHAT") token = config.StrField(env="TELEGRAM_TOKEN")
class ConsulConfig(config.Config): host = config.StrField(default="localhost", env="CONSUL_HOST") port = config.IntField(default=8500, env="CONSUL_PORT")
class TestConf(config.Config): debug = config.BoolField(default=False) secret_key = config.StrField()
class CustomConsulConfig(conf): host = config.StrField(default="consul.service.consul")
class CustomConsulConfig(conf): dc = config.StrField(default="dc", env="CONSUL_DC")
class ServiceConfig(config.Config): host = config.StrField() backend = config.StrField()