ichubconfig

package
v1.4.131 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MulanPSL-2.0 Imports: 20 Imported by: 56

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 InjectWebConfig added in v1.4.122

func InjectWebConfig(s *WebConfig)

func LoadIchubConfig added in v1.0.70

func LoadIchubConfig() baseiface.ISingleton

func LoadWebConfig added in v1.4.122

func LoadWebConfig() 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 {
	configdto.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"`
	Software       baseconfig.SoftwareDto
	Gocenter       baseconfig.GocenterDto `json:"gocenter"`

	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"`
			WebTimeout string `json:"web_timeout"`
		}
		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 NewIchubConfig added in v1.0.112

func NewIchubConfig() *IchubConfig

func (*IchubConfig) ChangeDbType added in v1.4.121

func (ic *IchubConfig) ChangeDbType(dbtype string) string

func (*IchubConfig) CheckEnvFileExist

func (ic *IchubConfig) CheckEnvFileExist() bool

func (*IchubConfig) CheckFileExist

func (ic *IchubConfig) CheckFileExist() bool

func (*IchubConfig) EnvFileName

func (ic *IchubConfig) EnvFileName() string

func (*IchubConfig) FullFileName

func (ic *IchubConfig) FullFileName() string

func (*IchubConfig) Log

func (ic *IchubConfig) Log()

func (*IchubConfig) LogFileName

func (ic *IchubConfig) LogFileName()

func (*IchubConfig) ParseRealFileName

func (ic *IchubConfig) ParseRealFileName() string

解析真正的环境文件名称

func (*IchubConfig) Read

func (ic *IchubConfig) Read() *IchubConfig

func (*IchubConfig) ReadConfig

func (ic *IchubConfig) ReadConfig(basePath string)

func (*IchubConfig) ReadConfigBase added in v1.4.122

func (ic *IchubConfig) ReadConfigBase(env ...string)

func (*IchubConfig) ReadConfigEnv

func (ic *IchubConfig) ReadConfigEnv() string

func (*IchubConfig) ReadConfigFile added in v1.4.122

func (ic *IchubConfig) ReadConfigFile() string

func (*IchubConfig) ReadDefault added in v1.4.123

func (ic *IchubConfig) ReadDefault() *IchubConfig

func (*IchubConfig) ReadDev added in v1.4.122

func (ic *IchubConfig) ReadDev() *IchubConfig

func (*IchubConfig) ReadFactroy added in v1.0.8

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

func (*IchubConfig) ReadGateway added in v1.0.14

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

func (*IchubConfig) ReadGocenter added in v1.0.603

func (ic *IchubConfig) ReadGocenter() *baseconfig.GocenterDto

func (*IchubConfig) ReadIchubCommon

func (ic *IchubConfig) ReadIchubCommon() *IchubConfig

func (*IchubConfig) ReadIchubDatasource

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

func (*IchubConfig) ReadIchubDb

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

func (*IchubConfig) ReadIchubEs

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

func (*IchubConfig) ReadIchubFactroy added in v1.0.9

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

func (*IchubConfig) ReadIchubGorm

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

func (*IchubConfig) ReadIchubMysql

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

func (*IchubConfig) ReadIchubRedis

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

func (*IchubConfig) ReadIchubRpc

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

func (*IchubConfig) ReadIchubWebClient

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

func (*IchubConfig) ReadIchubWebServer

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

func (*IchubConfig) ReadIf added in v1.0.6

func (ic *IchubConfig) ReadIf() *IchubConfig

func (*IchubConfig) ReadInt added in v1.0.5

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

func (*IchubConfig) ReadMap added in v1.0.5

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

func (*IchubConfig) ReadMapSlice added in v1.0.14

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

func (*IchubConfig) ReadMaster added in v1.4.122

func (ic *IchubConfig) ReadMaster() *IchubConfig

func (*IchubConfig) ReadNats added in v1.0.112

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

func (*IchubConfig) ReadRelease added in v1.4.122

func (ic *IchubConfig) ReadRelease() *IchubConfig

func (*IchubConfig) ReadString added in v1.0.5

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

func (*IchubConfig) ReadStringSlice added in v1.0.14

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

func (*IchubConfig) ReadStruct added in v1.0.5

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

"key1.key"

func (*IchubConfig) ReadTest added in v1.4.122

func (ic *IchubConfig) ReadTest() *IchubConfig

func (*IchubConfig) ReadVar added in v1.0.5

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

func (*IchubConfig) ReadVar2Rpc added in v1.4.101

func (ic *IchubConfig) ReadVar2Rpc(key string) *baseconfig.RpcServerDto

func (*IchubConfig) ReadVar2WebClient added in v1.4.101

func (ic *IchubConfig) ReadVar2WebClient(key string) *baseconfig.WebClientDto

func (*IchubConfig) ReadWebSwagger

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

func (*IchubConfig) RegisterEncDec added in v1.0.6

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

func (*IchubConfig) SetDefaultBasePath

func (ic *IchubConfig) SetDefaultBasePath(basepath string)

func (*IchubConfig) SetOsEnv

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

func (*IchubConfig) Single added in v1.4.101

func (ic *IchubConfig) Single() bool

type WebConfig added in v1.4.122

type WebConfig struct {
	basedto.BaseEntitySingle
	RootDir string
	CfgFile string
}

func FindBeanWebConfig added in v1.4.122

func FindBeanWebConfig() *WebConfig

func NewWebConfig added in v1.4.122

func NewWebConfig() *WebConfig

func (*WebConfig) BuildFileName added in v1.4.122

func (this *WebConfig) BuildFileName(env string) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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