config

package
v0.0.0-...-fce7651 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ConfigureAuth

func ConfigureAuth()

func ConfigureDatabaseCache

func ConfigureDatabaseCache(dialect pkg_constant.DialectDatabaseCache)

func ConfigureDatabaseSQL

func ConfigureDatabaseSQL(dialect pkg_constant.DialectDatabaseSQL)

func ConfigureEnv

func ConfigureEnv()

func ConfigureLog

func ConfigureLog()

Types

type DBSQLConfig

type DBSQLConfig struct {
	Host              string
	Port              string
	Name              string
	Username          string
	Password          string
	TimeZone          string
	ConnectionTimeout time.Duration
	MaxIdleConnection int
	MaxOpenConnection int
	DebugMode         bool
	AutoMigrate       bool
	AutoSeed          bool
}

type EnvConfig

type EnvConfig *struct {
	// APPS
	AppsName    string `mapstructure:"APPS_NAME"`
	AppsVersion string `mapstructure:"APPS_VERSION"`

	// SERVER
	ServerPort int `mapstructure:"SERVER_PORT"`

	// DATABASE SQL
	DatabaseMysqlHost                 string        `mapstructure:"DATABASE_MYSQL_HOST"`
	DatabaseMysqlPort                 string        `mapstructure:"DATABASE_MYSQL_PORT"`
	DatabaseMysqlName                 string        `mapstructure:"DATABASE_MYSQL_NAME"`
	DatabaseMysqlUsername             string        `mapstructure:"DATABASE_MYSQL_USERNAME"`
	DatabaseMysqlPassword             string        `mapstructure:"DATABASE_MYSQL_PASSWORD"`
	DatabaseMysqlConnectionTimeout    time.Duration `mapstructure:"DATABASE_MYSQL_CONNECTION_TIMEOUT"`
	DatabaseMysqlMaxIdleConnection    int           `mapstructure:"DATABASE_MYSQL_MAX_IDLE_CONNECTION"`
	DatabaseMysqlMaxOpenConnection    int           `mapstructure:"DATABASE_MYSQL_MAX_OPEN_CONNECTION"`
	DatabaseMysqlDebugMode            bool          `mapstructure:"DATABASE_MYSQL_DEBUG_MODE"`
	DatabaseMysqlAutoMigrate          bool          `mapstructure:"DATABASE_MYSQL_AUTO_MIGRATE"`
	DatabaseMysqlAutoSeed             bool          `mapstructure:"DATABASE_MYSQL_AUTO_SEED"`
	DatabasePostgresHost              string        `mapstructure:"DATABASE_POSTGRES_HOST"`
	DatabasePostgresPort              string        `mapstructure:"DATABASE_POSTGRES_PORT"`
	DatabasePostgresName              string        `mapstructure:"DATABASE_POSTGRES_NAME"`
	DatabasePostgresUsername          string        `mapstructure:"DATABASE_POSTGRES_USERNAME"`
	DatabasePostgresPassword          string        `mapstructure:"DATABASE_POSTGRES_PASSWORD"`
	DatabasePostgresTimeZone          string        `mapstructure:"DATABASE_POSTGRES_TIME_ZONE"`
	DatabasePostgresConnectionTimeout time.Duration `mapstructure:"DATABASE_POSTGRES_CONNECTION_TIMEOUT"`
	DatabasePostgresMaxIdleConnection int           `mapstructure:"DATABASE_POSTGRES_MAX_IDLE_CONNECTION"`
	DatabasePostgresMaxOpenConnection int           `mapstructure:"DATABASE_POSTGRES_MAX_OPEN_CONNECTION"`
	DatabasePostgresDebugMode         bool          `mapstructure:"DATABASE_POSTGRES_DEBUG_MODE"`
	DatabasePostgresAutoMigrate       bool          `mapstructure:"DATABASE_POSTGRES_AUTO_MIGRATE"`
	DatabasePostgresAutoSeed          bool          `mapstructure:"DATABASE_POSTGRES_AUTO_SEED"`

	// DATABASE SEEDER SQL
	DatabaseSeederMysqlUserIsRebuildData    IsRebuildDataDBSeederMysqlUser    `mapstructure:"DATABASE_SEEDER_MYSQL_USER_IS_REBUILD_DATA"`
	DatabaseSeederPostgresUserIsRebuildData IsRebuildDataDBSeederPostgresUser `mapstructure:"DATABASE_SEEDER_POSTGRES_USER_IS_REBUILD_DATA"`

	// DATABASE CACHE
	DatabaseCacheRedisAddress  string `mapstructure:"DATABASE_CACHE_REDIS_ADDRESS"`
	DatabaseCacheRedisPassword string `mapstructure:"DATABASE_CACHE_REDIS_PASSWORD"`
	DatabaseCacheRedisDatabase int    `mapstructure:"DATABASE_CACHE_REDIS_DATABASE"`

	// PASSWORD HASHING
	PasswordHashingHashSalt int `mapstructure:"PASSWORD_HASHING_HASH_SALT"`

	// JWT
	JWTSecretKey       string        `mapstructure:"JWT_SECRET_KEY"`
	JWTExpiredDuration time.Duration `mapstructure:"JWT_EXPIRED_DURATION"`
}
var (
	Env EnvConfig
)

type IsRebuildDataDBSeederMysqlUser

type IsRebuildDataDBSeederMysqlUser bool

type IsRebuildDataDBSeederPostgresUser

type IsRebuildDataDBSeederPostgresUser bool

type JWTAuthConfig

type JWTAuthConfig *jwtware.Config
var (
	JWTAuth JWTAuthConfig
)

type MysqlDatabaseSQLConnection

type MysqlDatabaseSQLConnection *gorm.DB

type PostgresDatabaseSQLConnection

type PostgresDatabaseSQLConnection *gorm.DB

type RedisDatabaseCacheConnection

type RedisDatabaseCacheConnection *redis.Client
var (
	RedisDBCache RedisDatabaseCacheConnection
)

Jump to

Keyboard shortcuts

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