configs

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackEndUrl

func BackEndUrl() string

func GetEmailPort

func GetEmailPort() int

func GetExpiredToken

func GetExpiredToken() int

func GetOtpExpired

func GetOtpExpired() time.Duration

func GetOtpLength

func GetOtpLength() int

func GetRabbitPort

func GetRabbitPort() int

func GetRedisDatabase

func GetRedisDatabase() int

func GetRedisDefaultCacheTimeOut

func GetRedisDefaultCacheTimeOut() time.Duration

func GetRedisMinIdleConn

func GetRedisMinIdleConn() int

func GetRedisPoolSize

func GetRedisPoolSize() int

func GetRedisPoolTimeout

func GetRedisPoolTimeout() int

func GetRedisPort

func GetRedisPort() int

func LoadEnv added in v0.0.4

func LoadEnv()

func ServiceName

func ServiceName() string

func UseRabbitMQ

func UseRabbitMQ() bool

Types

type AppConfig

type AppConfig struct {
	Name          string        `json:"name"`
	Env           string        `json:"env"`
	Port          string        `json:"port"`
	ExpiredToken  int           `json:"expired_token"`
	SecretKey     string        `json:"secret_key"`
	UseRabbitMQ   bool          `json:"use_rabbit_mq"`
	OtpLength     int           `json:"otp_length"`
	OtpExpired    time.Duration `json:"otp_expired"`
	BasicUsername string        `json:"basic_username"`
	BasicPassword string        `json:"basic_password"`
}

type Configs

type Configs struct {
	App      AppConfig
	DB       DbConfig
	Redis    RedisConfig
	RabbitMQ RabbitMQConfig
	Email    EmailConfig
}

func GetInstance

func GetInstance() *Configs

type DbConfig

type DbConfig struct {
	Host        string `json:"host"`
	Port        string `json:"port"`
	DbName      string `json:"db_name"`
	Username    string `json:"username"`
	Password    string `json:"password"`
	DbIsMigrate bool   `json:"db_is_migrate"`
	DebugMode   bool   `json:"debug_mode"`
}

type EmailConfig

type EmailConfig struct {
	Host         string `json:"host"`
	Port         int    `json:"port"`
	AuthEmail    string `json:"auth_email"`
	AuthPassword string `json:"auth_password"`
	Sender       string `json:"sender"`
}

type RabbitMQConfig

type RabbitMQConfig struct {
	Username string `json:"username"`
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Password string `json:"password"`
}

type RedisConfig

type RedisConfig struct {
	Host                string        `json:"host"`
	Port                int           `json:"port"`
	Password            string        `json:"password"`
	Database            int           `json:"database"`
	Master              string        `json:"master"`
	PoolSize            int           `json:"pool_size"`
	PoolTimeout         int           `json:"pool_timeout"`
	MinIdleConn         int           `json:"min_idle_conn"`
	DefaultCacheTimeOut time.Duration `json:"default_cache_time_out"`
}

Jump to

Keyboard shortcuts

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