config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MulanPSL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const CONFIG_FILE = "/config/application.yml"
View Source
const ENV_BASEPATH = "BasePath"

Variables

This section is empty.

Functions

This section is empty.

Types

type GeneralConfig

type GeneralConfig struct {
	BasePath   string
	ConfigFile string

	Redis struct {
		Db       int32
		Addr     string
		Password string
	}

	Server struct {
		Port int `yaml:"port"`
	} `yaml:"publisher"`

	// datasource
	Datasource struct {
		DriverName string `yaml:"driverName"`
		Host       string `yaml:"host"`
		Port       int    `yaml:"port"`

		Database string `yaml:"database"`
		Username string `yaml:"username"`
		Password string `yaml:"password"`
		Charset  string `yaml:"charset"`
	} `yaml:"datasource"`

	Rpc struct {
		HostIp     string `yaml:"hostIp"`
		ServerName string `yaml:"serverName"`
		ClientName string `yaml:"clientName"`
	} `yaml:"rpcservice"`

	Nats struct {
		Url string
	}
	Es struct {
		Url string
	}
}
var ConfigInst *GeneralConfig = &GeneralConfig{}

func NewGenealConfig

func NewGenealConfig() *GeneralConfig

func (*GeneralConfig) Ini

func (config *GeneralConfig) Ini() *GeneralConfig

func (*GeneralConfig) PrintDatasource

func (config *GeneralConfig) PrintDatasource()

func (*GeneralConfig) PrintRedisInfo

func (config *GeneralConfig) PrintRedisInfo()

func (*GeneralConfig) ReadConfig

func (config *GeneralConfig) ReadConfig()

func (*GeneralConfig) ReadDatasource

func (config *GeneralConfig) ReadDatasource(basePath string) any

func (*GeneralConfig) ReadRedis

func (config *GeneralConfig) ReadRedis(basePath string) any

func (*GeneralConfig) ReadRpc

func (config *GeneralConfig) ReadRpc(basePath string) any

func (*GeneralConfig) String

func (entity *GeneralConfig) String() string

Jump to

Keyboard shortcuts

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