config

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PostgresqlHosts          string        `env:"POSTGRESQL_HOSTS" envSeparator:":" envDefault:"localhost"`
	PostgresqlDbName         string        `env:"POSTGRESQL_DB_NAME"`
	PostgresqlUsername       string        `env:"POSTGRESQL_USERNAME"`
	PostgresqlPassword       string        `env:"POSTGRESQL_PASSWORD"`
	PostgresqlSslMode        string        `env:"POSTGRESQL_SSL_MODE" envDefault:"disable"`
	PostgresqlPort           string        `env:"POSTGRESQL_PORT" envDefault:"5432"`
	RedisHosts               string        `env:"REDIS_HOSTS" envSeparator:":" envDefault:"localhost"`
	RedisPort                string        `env:"REDIS_PORT" envDefault:"6379"`
	RedisUsername            string        `env:"REDIS_USERNAME"`
	RedisPassword            string        `env:"REDIS_PASSWORD"`
	RedisReadTimeout         time.Duration `env:"REDIS_READ_TIME_OUT" envDefault:"1s"`
	RedisWriteTimeout        time.Duration `env:"REDIS_WRITE_TIME_OUT" envDefault:"500ms"`
	PostgresqlReadTimeout    time.Duration `env:"POSTGRESQL_READ_TIME_OUT" envDefault:"2s"`
	PostgresqlWriteTimeout   time.Duration `env:"POSTGRESQL_WRITE_TIME_OUT" envDefault:"1s"`
	InMemoryDbUpdateInterval time.Duration `env:"IN_MEMORY_DB_UPDATE_INTERVAL" envDefault:"5s"`
	OpenAiKey                string        `env:"OPENAI_API_KEY"`
	StatsProvider            string        `env:"STATS_PROVIDER"`
	ProxyTimeout             time.Duration `env:"PROXY_TIMEOUT" envDefault:"180s"`
}

func ParseEnvVariables

func ParseEnvVariables() (*Config, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL