Documentation ¶
Overview ¶
Package config allows to build config for application
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { PostgresConnString string `env:"POSTGRES_URL"` MongoConnString string `env:"MONGO_URL"` RedisCfg RedisCfg JwtCfg JwtCfg RefreshTokenCfg RefreshTokenCfg }
Config contains necessary application configuration
type JwtCfg ¶
type JwtCfg struct { SigningMethod jwt.SigningMethod Issuer string `env:"AUTH_JWT_ISSUER" envDefault:"customers-api"` TimeToLive time.Duration `env:"AUTH_JWT_TIME_TO_LIVE" envDefault:"10m"` PrivateKey ed25519.PrivateKey `env:"AUTH_JWT_PRIVATE_KEY_FILE"` PublicKey ed25519.PublicKey `env:"AUTH_JWT_PUBLIC_KEY_FILE"` }
JwtCfg contains config for jwt
type RedisCfg ¶
type RedisCfg struct { Addr string `env:"REDIS_ADDR"` Password string `env:"REDIS_PASSWORD"` DB int `env:"REDIS_DB" envDefault:"0"` MaxRetries int `env:"REDIS_MAX_RETRIES" envDefault:"3"` PoolSize int `env:"REDIS_POOL_SIZE" envDefault:"50"` }
RedisCfg contains config for redis
type RefreshTokenCfg ¶
type RefreshTokenCfg struct { MaxCount int `env:"AUTH_REFRESH_TOKEN_MAX_COUNT" envDefault:"5"` TimeToLive time.Duration `env:"AUTH_REFRESH_TOKEN_TIME_TO_LIVE" envDefault:"720h"` }
RefreshTokenCfg contains config for refresh token
Click to show internal directories.
Click to hide internal directories.