config

package
v0.0.0-...-b696ed4 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 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 ApplicationConfig

type ApplicationConfig struct {
	Host string `mapstructure:"APP_HOST"`
	Port string `mapstructure:"APP_PORT"`
}

type Config

type Config struct {
	ApplicationConfig ApplicationConfig `mapstructure:"APP_CONFIG"`
	PostgresConfig    DBConfig          `mapstructure:"POSTGRESQL"`
	ElasticConfig     ElasticConfig     `mapstructure:"ELASTICSEARCH"`
	RedisConfig       RedisConfig       `mapstructure:"REDIS_CONFIG"`
	JWTSecretKey      string            `mapstructure:"JWT_SECRET_KEY"`
}

func Load

func Load() (conf Config)

type DBConfig

type DBConfig struct {
	Host     string `mapstructure:"POSTGRES_HOST"`
	Port     string `mapstructure:"POSTGRES_PORT"`
	Database string `mapstructure:"POSTGRES_DB"`
	Schema   string `mapstructure:"POSTGRES_SCHEMA"`
	User     string `mapstructure:"POSTGRES_USER"`
	Password string `mapstructure:"POSTGRES_PASSWORD"`
}

func (*DBConfig) GetDSN

func (db *DBConfig) GetDSN() (dsn string)

type ElasticConfig

type ElasticConfig struct {
	Address       string `mapstructure:"ESADDRESS"`
	IndexArticle  string `mapstructure:"ES_INDEX_ARTICLE"`
	IndexCategory string `mapstructure:"ES_INDEX_CATEGORY"`
}

type RedisConfig

type RedisConfig struct {
	Host     string `mapstructure:"REDIS_HOST"`
	Port     string `mapstructure:"REDIS_PORT"`
	Username string `mapstructure:"REDIS_USERNAME"`
	Password string `mapstructure:"REDIS_PASSWORD"`
	DB       int    `mapstructure:"REDIS_DB"`
}

Jump to

Keyboard shortcuts

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