ichubconfig

package
v1.0.202 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MulanPSL-2.0 Imports: 21 Imported by: 3

Documentation

Index

Constants

View Source
const ConfigfileApp = "/config/app.yml"
View Source
const ConfigfileAppCommon = "/config/app-common.yml"

commonfilename

View Source
const ConfigfileAppEnv = "/config/app-env.yml"

Variables

This section is empty.

Functions

func LoadIchubConfig added in v1.0.70

func LoadIchubConfig() baseiface.ISingleton

func LoadIchubConfigIni added in v1.0.61

func LoadIchubConfigIni() baseiface.ISingleton

Types

type IConfig added in v1.0.6

type IConfig interface {
	Read() *IchubConfig

	ReadMap(pathkey string) map[string]interface{}
	ReadVar(pathkey string) interface{}
	ReadInt(pathkey string) int
	ReadString(pathkey string) string
	ReadStruct(pathkey string, object interface{})

	RegisterEncDec(encdec encrypt.IEncDec) *IchubConfig

	ReadIchubDb() *baseconfig.DbClientDto
	ReadIchubDatasource() *baseconfig.DbClientDto
	ReadIchubMysql() *baseconfig.DbClientDto
	ReadIchubRpc() *baseconfig.RpcServerDto
	ReadIchubEs() *baseconfig.ElasticClientDto
	ReadIchubWebServer() (serverDto *baseconfig.WebServerDto)
	ReadIchubWebClient() (clientDto *baseconfig.WebClientDto)
	ReadWebSwagger() *baseconfig.SwaggerClientDto
}

type IchubConfig

type IchubConfig struct {
	baseconfig.IchubClientDto

	Env      string `json:"env"`
	BasePath string `json:"base_path"`

	EnvConfigFile  string `json:"env_config_file"`
	ConfigFile     string `json:"config_file"`
	RealConfigFile string `json:"real_config_file"`

	Register baseconfig.RegisterTypeDto `json:"register"`

	Etcd struct {
		Server struct {
			Hosturl string `json:"hosturl"`
		}
	}

	Rpc struct {
		ServerName string `json:"server_name"`
		ServerPort int    `json:"server_port"`
		ClientName string `json:"client_name"`
	}

	Web struct {
		Server struct {
			Name string `json:"name"`
			Port int    `json:"port"`
		}
		Client struct {
			Name    string `json:"name"`
			TestUrl string `json:"test_url"`
		}
		Swagger struct {
			Host     string `json:"host"`
			BasePath string `json:"base_path"`
			Version  string `json:"version"`
			Title    string `json:"title"`
			Enable   string `json:"enable"`
		}
	}

	Datasource struct {
		Dbtype string `json:"dbtype"`
		Dbname string `json:"dbname"`
		Host   string `json:"host"`
		Port   string `json:"port"`

		Username string `json:"username"`
		Password string `json:"password"`
		Sslmode  string `json:"sslmode"`
		Charset  string `json:"charset"`
	}

	Redis struct {
		Db       int    `json:"db"`
		Addr     string `json:"addr"`
		Password string `json:"password"`
	} `json:"redis"`

	Es struct {
		Url      string `json:"url"`
		Username string `json:"username,omitempty"`
		Password string `json:"password,omitempty"`
	}
	Mysql struct {
		Dbtype string `json:"dbtype"`
		Dbname string `json:"dbname"`
		Host   string `json:"host"`
		Port   string `json:"port"`

		Username string `json:"username"`
		Password string `json:"password"`
		Sslmode  string `json:"sslmode"`
		Charset  string `json:"charset"`
	}

	Gorm    baseconfig.GormClientDto
	Factroy baseconfig.FactroyClientDto
	Natscli baseconfig.NatsClientDto `json:"natscli"`

	Gateway baseconfig.GatewayDto
	// contains filtered or unexported fields
}

func Default added in v1.0.25

func Default() *IchubConfig

func FindBeanIchubConfig added in v1.0.70

func FindBeanIchubConfig() *IchubConfig

func New

func New(configFile string) *IchubConfig

func NewCommon

func NewCommon() *IchubConfig

func NewConfig

func NewConfig() *IchubConfig

func (*IchubConfig) CheckEnvFileExist

func (ichubConfig *IchubConfig) CheckEnvFileExist() bool

func (*IchubConfig) CheckFileExist

func (ichubConfig *IchubConfig) CheckFileExist() bool

func (*IchubConfig) EnvFileName

func (ichubConfig *IchubConfig) EnvFileName() string

func (*IchubConfig) FullFileName

func (ichubConfig *IchubConfig) FullFileName() string

func (*IchubConfig) Log

func (ichubConfig *IchubConfig) Log()

func (*IchubConfig) LogFileName

func (ichubConfig *IchubConfig) LogFileName()

func (*IchubConfig) ParseRealFileName

func (ichubConfig *IchubConfig) ParseRealFileName() string

解析真正的环境文件名称

func (*IchubConfig) Read

func (ichubConfig *IchubConfig) Read() *IchubConfig

func (*IchubConfig) ReadConfig

func (ichubConfig *IchubConfig) ReadConfig(basePath string)

func (*IchubConfig) ReadConfigEnv

func (ichubConfig *IchubConfig) ReadConfigEnv() string

func (*IchubConfig) ReadFactroy added in v1.0.8

func (ichubConfig *IchubConfig) ReadFactroy() baseconfig.FactroyClientDto

func (*IchubConfig) ReadGateway added in v1.0.14

func (ichubConfig *IchubConfig) ReadGateway() *baseconfig.GatewayDto

func (*IchubConfig) ReadIchubCommon

func (ichubConfig *IchubConfig) ReadIchubCommon() *IchubConfig

func (*IchubConfig) ReadIchubDatasource

func (ichubConfig *IchubConfig) ReadIchubDatasource() *baseconfig.DbClientDto

func (*IchubConfig) ReadIchubDb

func (ichubConfig *IchubConfig) ReadIchubDb() *baseconfig.DbClientDto

func (*IchubConfig) ReadIchubEs

func (ichubConfig *IchubConfig) ReadIchubEs() *baseconfig.ElasticClientDto

func (*IchubConfig) ReadIchubFactroy added in v1.0.9

func (ichubConfig *IchubConfig) ReadIchubFactroy() baseconfig.FactroyClientDto

func (*IchubConfig) ReadIchubGorm

func (ichubConfig *IchubConfig) ReadIchubGorm() *baseconfig.GormClientDto

func (*IchubConfig) ReadIchubMysql

func (ichubConfig *IchubConfig) ReadIchubMysql() *baseconfig.DbClientDto

func (*IchubConfig) ReadIchubRedis

func (ichubConfig *IchubConfig) ReadIchubRedis() *baseconfig.RedisClientDto

func (*IchubConfig) ReadIchubRpc

func (ichubConfig *IchubConfig) ReadIchubRpc() *baseconfig.RpcServerDto

func (*IchubConfig) ReadIchubWebClient

func (this *IchubConfig) ReadIchubWebClient() (clientDto *baseconfig.WebClientDto)

func (*IchubConfig) ReadIchubWebServer

func (ichubConfig *IchubConfig) ReadIchubWebServer() (serverDto *baseconfig.WebServerDto)

func (*IchubConfig) ReadIf added in v1.0.6

func (ichubConfig *IchubConfig) ReadIf() *IchubConfig

func (*IchubConfig) ReadInt added in v1.0.5

func (ichubConfig *IchubConfig) ReadInt(pathkey string) int

func (*IchubConfig) ReadMap added in v1.0.5

func (ichubConfig *IchubConfig) ReadMap(pathkey string) map[string]interface{}

func (*IchubConfig) ReadMapSlice added in v1.0.14

func (ichubConfig *IchubConfig) ReadMapSlice(pathkey string) map[string][]string

func (*IchubConfig) ReadNats added in v1.0.200

func (this *IchubConfig) ReadNats() *baseconfig.NatsClientDto

func (*IchubConfig) ReadString added in v1.0.5

func (ichubConfig *IchubConfig) ReadString(pathkey string) string

func (*IchubConfig) ReadStringSlice added in v1.0.14

func (ichubConfig *IchubConfig) ReadStringSlice(pathkey string) []string

func (*IchubConfig) ReadStruct added in v1.0.5

func (ichubConfig *IchubConfig) ReadStruct(pathkey string, object interface{})

"key1.key"

func (*IchubConfig) ReadVar added in v1.0.5

func (ichubConfig *IchubConfig) ReadVar(pathkey string) interface{}

func (*IchubConfig) ReadWebSwagger

func (ichubConfig *IchubConfig) ReadWebSwagger() *baseconfig.SwaggerClientDto

func (*IchubConfig) RegisterEncDec added in v1.0.6

func (ichubConfig *IchubConfig) RegisterEncDec(encdec encrypt.IEncDec) *IchubConfig

func (*IchubConfig) SetDefaultBasePath

func (ichubConfig *IchubConfig) SetDefaultBasePath(basepath string)

func (*IchubConfig) SetOsEnv

func (ichubConfig *IchubConfig) SetOsEnv(key, value string) *IchubConfig

type IchubConfigIni

type IchubConfigIni struct {
	basedto.BaseEntity
	ConfigFileName string
	// contains filtered or unexported fields
}

func FindBeanIchubConfigIni added in v1.0.61

func FindBeanIchubConfigIni() *IchubConfigIni

func NewIchubConfigIni

func NewIchubConfigIni() *IchubConfigIni

func (*IchubConfigIni) CheckFileExist

func (ichubConfigIni *IchubConfigIni) CheckFileExist(filename string) bool

func (*IchubConfigIni) Find

func (ichubConfigIni *IchubConfigIni) Find(key string) *ini.Section

func (*IchubConfigIni) Find2Map

func (ichubConfigIni *IchubConfigIni) Find2Map() map[string]string

func (*IchubConfigIni) FindCms

func (ichubConfigIni *IchubConfigIni) FindCms() *ini.Section

func (*IchubConfigIni) FindGeneral

func (ichubConfigIni *IchubConfigIni) FindGeneral() *ini.Section

logrus.Debug(cfgIni.Find("general"))

func (*IchubConfigIni) FindMap

func (ichubConfigIni *IchubConfigIni) FindMap(domain string) map[string]string

func (*IchubConfigIni) Load

func (ichubConfigIni *IchubConfigIni) Load(defFile string) error

type MicroConfig

type MicroConfig struct {
	Conf config.Config
}

@Title 文件名称: MicroConfig.go @Description 描述: MicroConfig

@Author 作者: leijianming@163.com 时间(2024-01-31 22:38:21) @Update 作者: leijianming@163.com 时间(2024-01-31 22:38:21)

func (*MicroConfig) Get

func (cfg *MicroConfig) Get(paths ...string) reader.Value

func (*MicroConfig) Load

func (cfg *MicroConfig) Load() (config.Config, error)

Jump to

Keyboard shortcuts

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