baseconfig

package
v1.0.1-rel-01 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: AFL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENV_VALUE_EMPTY = "none"
	ITEM_KEY        = "ITEM_KEY"

	ENC_FLAG = "enc("
)

Variables

This section is empty.

Functions

func InjectConfigItem

func InjectConfigItem(s *ConfigItem)

func InjectIchubClientDto

func InjectIchubClientDto(s *IchubClientDto)

func LoadConfigItem

func LoadConfigItem() baseiface.ISingleton

func LoadIchubClientDto

func LoadIchubClientDto() baseiface.ISingleton

Types

type ConfigItem

type ConfigItem struct {
	// 键值
	Key string `json:"key"`
	// 配置值
	Value string `json:"value"`
	// 环境变量
	EnvValue string `json:"env_value"`
	// 默认值
	DefaultValue string `json:"default_value"`
	// 实际值
	EndValue string `json:"end_value"`

	basedto.BaseEntity
}

func FindBeanConfigItem

func FindBeanConfigItem() *ConfigItem

FindBeanConfigItem

func NewConfigItem

func NewConfigItem() *ConfigItem

func NewConfigItemBy

func NewConfigItemBy(k, v string) *ConfigItem

func (*ConfigItem) Check

func (this *ConfigItem) Check() bool

func (*ConfigItem) Decrypt

func (this *ConfigItem) Decrypt() string

decrypt

func (*ConfigItem) Encrypt

func (this *ConfigItem) Encrypt()

func (*ConfigItem) IfEnc

func (this *ConfigItem) IfEnc() bool

decrypt

func (*ConfigItem) ParseValue

func (this *ConfigItem) ParseValue() *ConfigItem

${HOSTURL:huawei.akunlong.top:2379}

type DbClientDto

type DbClientDto struct {
	IchubClientDto

	DbConnName string `json:"db_conn_name"`
	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"`

	GormClient *GormClientDto `json:"gorm_client"`
}

func NewDbClientDto

func NewDbClientDto() *DbClientDto

func (*DbClientDto) CacheKey

func (this *DbClientDto) CacheKey() string

func (*DbClientDto) IfCms

func (this *DbClientDto) IfCms() bool

func (*DbClientDto) IfCockdb

func (this *DbClientDto) IfCockdb() bool

func (*DbClientDto) IfHub

func (this *DbClientDto) IfHub() bool

func (*DbClientDto) IfMedusa

func (this *DbClientDto) IfMedusa() bool

func (*DbClientDto) IfMysql

func (this *DbClientDto) IfMysql() bool

func (*DbClientDto) IfPostgres

func (this *DbClientDto) IfPostgres() bool

func (*DbClientDto) IsMysql

func (this *DbClientDto) IsMysql() bool

type ElasticClientDto

type ElasticClientDto struct {
	IchubClientDto
	URL string `json:"url"`
	//("http://192.168.4.111:9200,"),
	// 设置基于http esconst auth验证的账号和密码 	//elastic.SetBasicAuth("elastic", "123456"),
	Enable              bool   `json:"enable"`
	Username            string `json:"username"`
	Password            string `json:"password"`
	SniffEnabled        string `json:"sniffenabled"`        //  false  是否设置嗅探器
	HealthcheckInterval int    `json:"healthcheckinterval"` //   10s
	// 启用gzip压缩
	Gzip bool `json:"gzip"`
}

func NewElasticClientDto

func NewElasticClientDto() *ElasticClientDto

type FactroyClientDto

type FactroyClientDto struct {
	Author string
	PkgNew string
	PkgNow string
}

func NewFactroyClientDto

func NewFactroyClientDto() *FactroyClientDto

type GormClientDto

type GormClientDto struct {
	IchubClientDto `json:"-"`

	Debug  string `json:"debug"`
	DbType string `json:"db_type"`
	Enable string `json:"enabled"`

	MaxLifetime  string `json:"max_lifetime"`
	MaxOpenConns string `json:"max_open_conns"`
	MaxIdleConns string `json:"max_idle_conns"`
}

func NewGormClientDto

func NewGormClientDto() *GormClientDto

type IIchubClient

type IIchubClient interface {
	ParseValue(key, value string) string
	CopyWithOption(from interface{})
	Parse() IIchubClient
}

type IchubClientDto

type IchubClientDto struct {
	basedto.BaseEntity
}

func FindBeanIchubClientDto

func FindBeanIchubClientDto() *IchubClientDto

FindBeanIchubClientDto

func NewIchubClientDto

func NewIchubClientDto() *IchubClientDto

func (*IchubClientDto) Parse

func (this *IchubClientDto) Parse() IIchubClient

func (*IchubClientDto) ParseSome

func (this *IchubClientDto) ParseSome(some interface{})

func (*IchubClientDto) ParseStruct

func (this *IchubClientDto) ParseStruct(value reflect.Value)

func (*IchubClientDto) ParseValue

func (this *IchubClientDto) ParseValue(key, value string) string

func (*IchubClientDto) ParseValues

func (this *IchubClientDto) ParseValues(key string, values ...*string)

type IpfsDto

type IpfsDto struct {
	IchubClientDto
	Upload   string `json:"upload"`
	Download string `json:"download"`
}

func NewIpfsDto

func NewIpfsDto() *IpfsDto

type NatsClientDto

type NatsClientDto struct {
	IchubClientDto

	Url     string `json:"url"`
	Timeout string `json:"timeout"`

	Subscribe struct {
		TopicSync  string
		TopicAsync string
	}
}

func NewNatsClientDto

func NewNatsClientDto() *NatsClientDto

type RedisClientDto

type RedisClientDto struct {
	IchubClientDto

	Addr     string `json:"addr"`     //  "192.168.14.58:6379",
	Password string `json:"password"` // "KiZ9dJBSk1cju",
	DB       int    `json:"DB"`
}

func NewRedisClientDto

func NewRedisClientDto() *RedisClientDto

type RpcServerDto

type RpcServerDto struct {
	IchubClientDto
	EtcdHost   string `json:"etcd_host"`
	ServerName string `json:"servername"`
	Ver        string `json:"version"`
	ClientName string `json:"-"`
	ServerPort string `json:"serverport"`
}

@Title 文件名称: RpcServerDto.go @Description 描述: Rpc服务配置信息

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

func NewRpcServerDto

func NewRpcServerDto() *RpcServerDto

type SoftwareDto

type SoftwareDto struct {
	IchubClientDto
	Env       string `json:"env"`
	Author    string `json:"author"`
	WebPrefix string `json:"webPrefix"`
	Corp      string `json:"corp"`
	LogLevel  string `json:"logLevel"`

	Ver      string `json:"version"`
	Salt     string `json:"salt"`
	Name     string `json:"name"`
	Platform struct {
		ShopId string
	}
}

func NewSoftwareDto

func NewSoftwareDto() *SoftwareDto

type SwaggerClientDto

type SwaggerClientDto struct {
	IchubClientDto `json:"-"`
	Host           string `json:"host"`
	BasePath       string `json:"base_path"`
	Version        string `json:"version"`
	Title          string `json:"title"`
	Enable         string `json:"enable"`
}

func NewSwaggerClientDto

func NewSwaggerClientDto() *SwaggerClientDto

func (*SwaggerClientDto) SwaggerUrl

func (this *SwaggerClientDto) SwaggerUrl() string

type WebClientDto

type WebClientDto struct {
	IchubClientDto
	//used by gorpcclient
	EtcdHost      string `json:"etcd_host"`
	ServerName    string `json:"name"`
	TestUrl       string `json:"test_url"`
	EnableTestUrl string `json:"-"`
	WebTimeout    string `json:"web_timeout"`
}

@Title 文件名称: WebServerDto.go @Description 描述: Web服务配置信息

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

func NewWebClientDto

func NewWebClientDto() *WebClientDto

type WebServerDto

type WebServerDto struct {
	EtcdHost   string `json:"etcd_host"`
	ServerName string `json:"server_name"`
	ServerPort int    `json:"server_port"`
	Ver        string `json:"ver"`
	Backend    string `json:"backend"`
	IchubClientDto
}

@Title 文件名称: WebServerDto.go @Description 描述: Web服务配置信息

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

func NewWebServerDto

func NewWebServerDto() *WebServerDto

func (*WebServerDto) IfBackend

func (self *WebServerDto) IfBackend() bool

func (*WebServerDto) String

func (self *WebServerDto) String() string

Jump to

Keyboard shortcuts

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