Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct { AccessTokenLifeTime time.Duration `env:"ACCESS_TOKEN_LIFETIME" envDefault:"720h" toml:"access_token_lifetime"` RefreshTokenLifeTime time.Duration `env:"REFRESH_TOKEN_LIFETIME" envDefault:"720h" toml:"refresh_token_lifetime"` PasswordDifficult float64 `env:"MIN_PASSWORD_ENTROPY" toml:"password_difficult"` AuthTokenSize int `env:"AUTH_TOKEN_SIZE" toml:"auth_token_size"` }
type Config ¶
type Config struct { Postgres Postgres `toml:"postgres"` HTTPS HTTPS `toml:"https"` Server Server `toml:"server"` Test Test `toml:"-"` Auth Auth `toml:"auth"` }
Config ...
func New ¶
func New() *Config
New creates new config once and return singleton object every time when called.
type Postgres ¶
type Postgres struct { User string `env:"POSTGRES_USER" toml:"user"` Password string `env:"POSTGRES_PASSWORD" toml:"password"` Port uint `env:"POSTGRES_PORT" toml:"port"` Addr string `env:"POSTGRES_ADDR" toml:"host"` Name string `env:"POSTGRES_NAME" toml:"name"` URI string `env:"DB_URI"` }
Postgres ...
type Server ¶
type Server struct { Type string `env:"SERVER_TYPE" toml:"type" valid:"in(grpc|http|https|GRPC|HTTP|HTTPS)" envDefault:"HTTP"` EnableHTTP bool `toml:"-"` EnableGRPC bool `toml:"-"` Salt string `env:"ENCRYPT_SALT" valid:"required~use generated salt from the logs" toml:"salt"` SecretKey string `env:"SECRET_KEY" valid:"required" toml:"secret_key"` IsDev bool `env:"IS_DEV" toml:"is_dev"` IsProd bool `env:"IS_PRODUCTION" toml:"is_prod"` Port uint `env:"BIND_PORT" toml:"port"` Addr string `env:"BIND_ADDR" toml:"addr"` BaseURL string `env:"BASE_URL" toml:"base_url"` InviteLinkTemplate string `env:"INVITE_LINK_TEMPLATE"` }
Server is internal configuration of server.
Click to show internal directories.
Click to hide internal directories.