baseconfig

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MulanPSL-2.0 Imports: 13 Imported by: 14

Documentation

Index

Constants

View Source
const ITEM_KEY = "ITEM_KEY"

Variables

View Source
var Context = NewConfigContext()

@Title 文件名称: configcontext.go @Description 描述: 配置上下文

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

Functions

This section is empty.

Types

type ConfigContext added in v1.0.6

type ConfigContext struct {
	// contains filtered or unexported fields
}

func NewConfigContext added in v1.0.6

func NewConfigContext() *ConfigContext

func (*ConfigContext) Encdec added in v1.0.6

func (this *ConfigContext) Encdec() encrypt.IEncDec

func (*ConfigContext) Env_vars added in v1.0.6

func (this *ConfigContext) Env_vars() map[string]any

func (*ConfigContext) FindVar added in v1.0.6

func (this *ConfigContext) FindVar(key string)

func (*ConfigContext) Ini added in v1.0.6

func (this *ConfigContext) Ini()

func (*ConfigContext) PutVar added in v1.0.6

func (this *ConfigContext) PutVar(key string, value any)

func (*ConfigContext) RegisterEncDec added in v1.0.6

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

func (*ConfigContext) SetEncdec added in v1.0.6

func (this *ConfigContext) SetEncdec(encdec encrypt.IEncDec)

func (*ConfigContext) SetEnv_vars added in v1.0.6

func (this *ConfigContext) SetEnv_vars(env_vars map[string]any)

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 NewConfigItem

func NewConfigItem(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() string

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

	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) IsMysql added in v1.0.10

func (this *DbClientDto) IsMysql() bool

func (*DbClientDto) MakeCockroachUrl added in v1.0.3

func (this *DbClientDto) MakeCockroachUrl() string

func (*DbClientDto) MakeMysqlUrl added in v1.0.2

func (this *DbClientDto) MakeMysqlUrl() string

func (*DbClientDto) MakePostgresUrl added in v1.0.4

func (this *DbClientDto) MakePostgresUrl() string

type ElasticClientDto

type ElasticClientDto struct {
	IchubClientDto
	URL string `json:"url"` //("http://192.168.4.111:9200,"),
	// 设置基于http base auth验证的账号和密码
	//elastic.SetBasicAuth("elastic", "123456"),
	Username string `json:"username"`
	Password string `json:"password"`
	// 启用gzip压缩
	Gzip bool `json:"gzip"`
}

func NewElasticClientDto

func NewElasticClientDto() *ElasticClientDto

func (*ElasticClientDto) Parse

func (this *ElasticClientDto) Parse() *ElasticClientDto

type FactroyClientDto added in v1.0.4

type FactroyClientDto struct {
	Author    string
	PathNew   string
	PathShop  string
	PathNow   string
	PathTest  string
	Time2Int  string
	JsonCamel bool
}

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 any)
	Parse() IIchubClient
}

type IchubClientDto

type IchubClientDto struct {
	basedto.BaseEntity
}

func (*IchubClientDto) Parse

func (this *IchubClientDto) Parse() IIchubClient

func (*IchubClientDto) ParseSome added in v1.0.4

func (this *IchubClientDto) ParseSome(some any)

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

func (*RedisClientDto) Parse

func (this *RedisClientDto) Parse() *RedisClientDto

type RpcServerDto

type RpcServerDto struct {
	IchubClientDto
	EtcdHost   string `json:"etcd_host"`
	ServerName string `json:"server_name"`
	ClientName string `json:"client_name"`
	ServerPort int    `json:"server_port"`
}

@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 (*RpcServerDto) Parse

func (this *RpcServerDto) Parse() *RpcServerDto

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

type WebClientDto

type WebClientDto struct {
	//bServerDto `json:"web_server_dto"`
	//used by client
	EtcdHost   string `json:"etcd_host"`
	ServerName string `json:"server_name"`
	TestUrl    string `json:"test_url"`
	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 NewWebClientDto

func NewWebClientDto() *WebClientDto

func (*WebClientDto) Parse

func (this *WebClientDto) Parse() *WebClientDto

type WebServerDto

type WebServerDto struct {
	EtcdHost   string `json:"etcd_host"`
	ServerName string `json:"server_name"`
	ServerPort int    `json:"server_port"`

	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) Parse

func (this *WebServerDto) Parse() *WebServerDto

func (*WebServerDto) String

func (this *WebServerDto) String() string

Jump to

Keyboard shortcuts

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