config

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEVELOPER           = "developer"
	HOMOLOGATION        = "homologation"
	PRODUCTION          = "production"
	TARGET_DEPLOY_LOCAL = "local"
	TARGET_DEPLOY_NUVEM = "nuvem"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobStorage added in v0.5.0

type BlobStorage struct {
	BS_ACCOUNT_NAME    string `json:"account_name"`
	BS_ACCOUNT_KEY     string `json:"account_key"`
	BS_SERVICE_URL     string `json:"service_url"`
	BS_URL_EXPIRY_TIME int64  `json:"bs_url_expiry_time"`
}

type Config

type Config struct {
	AppName           string `json:"app_name"`
	AppMode           string `json:"app_mode"`
	AppLogLevel       string `json:"app_log_level"`
	AppTargetDeploy   string `json:"app_target_deploy"`
	AppCommitShortSha string `json:"commit_short_sha"`
	AppVersion        string `json:"version"`

	*HttpConfig
	*MongoDBConfig
	*RedisDBConfig
	*PGSQLConfig
	*RMQConfig
	*BlobStorage
	// contains filtered or unexported fields
}

func NewDefaultConf added in v0.8.0

func NewDefaultConf() *Config

func (*Config) GetGlobalLogger added in v0.8.0

func (c *Config) GetGlobalLogger() *log.Logger

func (*Config) Reload added in v0.8.0

func (c *Config) Reload()

func (*Config) SetGlobalLogger added in v0.8.0

func (c *Config) SetGlobalLogger(logger *log.Logger)

type HttpConfig

type HttpConfig struct {
	PORT   string      `json:"port"`
	Logger *log.Logger `json:"-"`
}

type MongoDBConfig

type MongoDBConfig struct {
	MDB_URI                string `json:"mdb_uri"`
	MDB_NAME               string `json:"mdb_name"`
	MDB_DEFAULT_COLLECTION string `json:"mdb_default_collection"`
}

type PGSQLConfig

type PGSQLConfig struct {
	DB_DRIVE                  string `json:"db_drive"`
	DB_HOST                   string `json:"db_host"`
	DB_PORT                   string `json:"db_port"`
	DB_USER                   string `json:"db_user"`
	DB_PASS                   string `json:"db_pass"`
	DB_NAME                   string `json:"db_name"`
	DB_SSL_MODE               bool   `json:"db_ssl_mode"`
	DB_CONNECT_TIMEOUT        int    `json:"db_connect_timeout"`
	DB_DSN                    string `json:"-"`
	DB_SET_MAX_OPEN_CONNS     int    `json:"db_set_max_open_conns"`
	DB_SET_MAX_IDLE_CONNS     int    `json:"db_set_max_idle_conns"`
	DB_SET_CONN_MAX_LIFE_TIME int    `json:"db_set_conn_max_life_time"`
}

type RMQConfig

type RMQConfig struct {
	RMQ_URI                  string `json:"rmq_uri"`
	RMQ_MAXX_RECONNECT_TIMES int    `json:"rmq_maxx_reconnect_times"`
}

type RedisDBConfig

type RedisDBConfig struct {
	RDB_HOST       string `json:"rdb_host"`
	RDB_PORT       string `json:"rdb_port"`
	RDB_USER       string `json:"rdb_user"`
	RDB_PASS       string `json:"rdb_pass"`
	RDB_DB         int64  `json:"rdb_db"`
	RDB_DSN        string `json:"-"`
	PUBSUB_CHANNEL string `json:"-"`
}

Jump to

Keyboard shortcuts

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