config

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DEFAULT_VALUES map[string]string = map[string]string{
		"HOST":             "localhost:3000",
		"DEBUG_HOST":       "localhost:8080",
		"REDIS_HOST":       "localhost:6379",
		"REDIS_PASSW":      "",
		"REDIS_DB":         "0",
		"LOG_FILE":         "./log.txt",
		"SUPER_USER_EMAIL": "admin@aisog.ru",
		"SUPER_USER_PASSW": "Adm1n",
		"MEDIA_PATH":       "media",
	}

	TokenExpires         time.Duration = time.Minute * 30
	RefreshTokenExpaires time.Duration = time.Hour * 24 * 365
)

Functions

This section is empty.

Types

type Config

type Config struct {
	BasePath    string
	Debug       bool   `env:"DEBUG"`
	SecretKey   string `env:"SECRET_KEY"`
	Host        string `env:"HOST"`
	DebugHost   string `env:"DEBUG_HOST"`
	StartWorker bool   `env:"START_WORKER"`

	PSQLServerHost string `env:"PSQLDB_HOST"`
	PSQLPort       string `env:"PSQLDB_PORT"`
	PSQLDatabase   string `env:"PSQLDB_NAME"`
	PSQLUserName   string `env:"PSQLDB_USER"`
	PSQLPasswd     string `env:"PSQLDB_PASSWORD"`

	RedisHost   string `env:"REDIS_HOST"`
	RedisPasswd string `env:"REDIS_PASSW"`
	RedisDB     int    `env:"REDIS_DB"`

	TokenExpires         time.Duration
	RefreshTokenExpaires time.Duration

	EmailHost         string `env:"EMAIL_HOST"`
	EmailPort         int    `env:"EMAIL_PORT"`
	EmailHostUser     string `env:"EMAIL_HOST_USER"`
	EmailHostPassword string `env:"EMAIL_HOST_PASSWORD"`

	SuperUserEmail string `env:"SUPER_USER_EMAIL"`
	SuperUserPassw string `env:"SUPER_USER_PASSW"`

	MediaPath string `env:"MEDIA_PATH"`

	LogFile string `env:"LOG_FILE"`
}

func Get

func Get() *Config

func (*Config) GetMediaPath

func (c *Config) GetMediaPath() string

Jump to

Keyboard shortcuts

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