ichubconfig

package
v1.0.18 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MulanPSL-2.0 Imports: 19 Imported by: 24

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

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"`

	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"`

	Nats struct {
		Url string `json:"url"`
	}
	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

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

func New

func New(configFile string) *IchubConfig

func NewCommon

func NewCommon() *IchubConfig

func NewConfig

func NewConfig() *IchubConfig

func (*IchubConfig) CheckEnvFileExist

func (this *IchubConfig) CheckEnvFileExist() bool

func (*IchubConfig) CheckFileExist

func (this *IchubConfig) CheckFileExist() bool

func (*IchubConfig) EnvFileName

func (this *IchubConfig) EnvFileName() string

func (*IchubConfig) FullFileName

func (this *IchubConfig) FullFileName() string

func (*IchubConfig) Log

func (this *IchubConfig) Log()

func (*IchubConfig) LogFileName

func (this *IchubConfig) LogFileName()

func (*IchubConfig) ParseRealFileName

func (this *IchubConfig) ParseRealFileName() string

func (*IchubConfig) Read

func (this *IchubConfig) Read() *IchubConfig

func (*IchubConfig) ReadConfig

func (this *IchubConfig) ReadConfig(basePath string)

func (*IchubConfig) ReadConfigEnv

func (this *IchubConfig) ReadConfigEnv() string

func (*IchubConfig) ReadFactroy added in v1.0.8

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

func (*IchubConfig) ReadGateway added in v1.0.14

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

func (*IchubConfig) ReadIchubCommon

func (this *IchubConfig) ReadIchubCommon() *IchubConfig

func (*IchubConfig) ReadIchubDatasource

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

func (*IchubConfig) ReadIchubDb

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

func (*IchubConfig) ReadIchubEs

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

func (*IchubConfig) ReadIchubFactroy added in v1.0.9

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

func (*IchubConfig) ReadIchubGorm

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

func (*IchubConfig) ReadIchubMysql

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

func (*IchubConfig) ReadIchubRedis

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

func (*IchubConfig) ReadIchubRpc

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

func (*IchubConfig) ReadIchubWebClient

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

func (*IchubConfig) ReadIchubWebServer

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

func (*IchubConfig) ReadIf added in v1.0.6

func (this *IchubConfig) ReadIf() *IchubConfig

func (*IchubConfig) ReadInt added in v1.0.5

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

func (*IchubConfig) ReadMap added in v1.0.5

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

func (*IchubConfig) ReadMapSlice added in v1.0.14

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

func (*IchubConfig) ReadString added in v1.0.5

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

func (*IchubConfig) ReadStringSlice added in v1.0.14

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

func (*IchubConfig) ReadStruct added in v1.0.5

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

"key1.key"

func (*IchubConfig) ReadVar added in v1.0.5

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

func (*IchubConfig) ReadWebSwagger

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

func (*IchubConfig) RegisterEncDec added in v1.0.6

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

func (*IchubConfig) SetDefaultBasePath

func (this *IchubConfig) SetDefaultBasePath(basepath string)

func (*IchubConfig) SetOsEnv

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

type IchubConfigIni

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

func NewIchubConfigIni

func NewIchubConfigIni() *IchubConfigIni

func (*IchubConfigIni) CheckFileExist

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

func (*IchubConfigIni) Find

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

func (*IchubConfigIni) Find2Map

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

func (*IchubConfigIni) FindCms

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

func (*IchubConfigIni) FindGeneral

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

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

func (*IchubConfigIni) FindMap

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

func (*IchubConfigIni) Load

func (this *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