config

package
v0.0.0-...-b1d2da9 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server  ServerConfig
	Service ServiceConfig
	DB      DBConfig
}

type DBConfig

type DBConfig struct {
	Host     string `envconfig:"DB_HOST"`
	Port     string `envconfig:"DB_PORT"`
	User     string `envconfig:"DB_USER"`
	Password string `envconfig:"DB_PASSWORD"`
	Database string `envconfig:"DB_DATABASE"`
}

type IConfig

type IConfig interface {
	Server() ServerConfig
	Service() ServiceConfig
	DB() DBConfig
}
var GlobalConfig IConfig

func BuildConfig

func BuildConfig() IConfig

type IMysqlInstance

type IMysqlInstance interface {
	Database() *gorm.DB
}

func ConnectMysql

func ConnectMysql(cfg MysqlConfig) (IMysqlInstance, error)

type MysqlConfig

type MysqlConfig struct {
	Host     string
	Port     string
	User     string
	Password string
	Database string
}

type ServerConfig

type ServerConfig struct {
	Port      string `envconfig:"SERVER_PORT"`
	JWTSecret string `envconfig:"JWT_SECRET"`
}

type ServiceConfig

type ServiceConfig struct {
	TransferFee        float64 `envconfig:"TRANSFER_FEE"`
	TransferFeeEnabled bool    `envconfig:"TRANSFER_FEE_ENABLED"`
	SMSInfoEnabled     bool    `envconfig:"SMS_INFO_ENABLED"`
}

Directories

Path Synopsis
Package mock_config is a generated GoMock package.
Package mock_config is a generated GoMock package.

Jump to

Keyboard shortcuts

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