config

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

type Env struct {
	AppPort  string `env:"APP_PORT"`
	AppName  string `env:"APP_NAME"`
	AppDebug bool   `env:"APP_DEBUG"`
	AppEnv   string `env:"APP_ENV"`

	JwtSecret string `env:"JWT_SECRET"`

	DbConnection string `env:"DB_CONNECTION"`
	DbHost       string `env:"DB_HOST"`
	DbPort       string `env:"DB_PORT"`
	DbDatabase   string `env:"DB_DATABASE"`
	DbUsername   string `env:"DB_USERNAME"`
	DbPassword   string `env:"DB_PASSWORD"`

	MailHost     string `env:"MAIL_HOST"`
	MailPort     string `env:"MAIL_PORT"`
	MailUser     string `env:"MAIL_USER"`
	MailPassword string `env:"MAIL_PASSWORD"`
	MailFrom     string `env:"MAIL_FROM"`

	StorageHost       string `env:"STORAGE_HOST"`
	StoragePort       string `env:"STORAGE_PORT"`
	StorageAccessKey  string `env:"STORAGE_ACCESS_KEY"`
	StorageSecretKey  string `env:"STORAGE_SECRET_KEY"`
	StorageBucketName string `env:"STORAGE_BUCKET_NAME"`
	StorageUseSSL     bool   `env:"STORAGE_USE_SSL"`

	FirebaseMessagingUrl string `env:"FIREBASE_MESSAGING_URL"`
	FirebaseMessagingKey string `env:"FIREBASE_MESSAGING_KEY"`

	RedisHost     string `env:"REDIS_HOST"`
	RedisPort     string `env:"REDIS_PORT"`
	RedisDatabase int    `env:"REDIS_DATABASE"`
	RedisUsername string `env:"REDIS_USERNAME"`
	RedisPassword string `env:"REDIS_PASSWORD"`

	MongodbHost     string `env:"MONGO_HOST"`
	MongodbPort     string `env:"MONGO_PORT"`
	MongodbUsername string `env:"MONGO_USERNAME"`
	MongodbPassword string `env:"MONGO_PASSWORD"`

	TiktokApiAppKey    string `env:"TIKTOK_API_APP_KEY"`
	TiktokApiAppSecret string `env:"TIKTOK_API_APP_SECRET"`

	ExternalHost         string `env:"EXTERNAL_HOST"`
	ExternalClientId     string `env:"EXTERNAL_CLIENT_ID"`
	ExternalClientSecret string `env:"EXTERNAL_CLIENT_SECRET"`

	TelegramBotToken  string `env:"TELEGRAM_BOT_TOKEN"`
	TelegramBotChatId int    `env:"TELEGRAM_BOT_CHAT_ID"`
}

func Load

func Load() *Env

Load loads configuration from .env file and environment variables

func (*Env) GetEnvAsBool

func (pkg *Env) GetEnvAsBool(key string, defaultValue bool) bool

func (*Env) GetEnvAsInt

func (pkg *Env) GetEnvAsInt(key string, defaultValue int) int

func (*Env) GetEnvString

func (pkg *Env) GetEnvString(key, defaultValue string) string

Jump to

Keyboard shortcuts

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