baseconfig

package
v1.0.200 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MulanPSL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ITEM_KEY = "ITEM_KEY"
View Source
const SEVICE_NAME_NONE = "web.none.com"

@Title 文件名称: GatewayDto.go @Description 描述: GatewayDto配置信息

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

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

func LoadConfigItem added in v1.0.61

func LoadConfigItem() baseiface.ISingleton

func LoadFactroyClientDto added in v1.0.61

func LoadFactroyClientDto() baseiface.ISingleton

func LoadIchubClientDto added in v1.0.61

func LoadIchubClientDto() baseiface.ISingleton

Types

type BypassDto added in v1.0.18

type BypassDto struct {
	Path string `json:"path"`
}

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 FindBeanConfigItem added in v1.0.61

func FindBeanConfigItem() *ConfigItem

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
	PathShop   string
	PathNow    string
	PathApp    string
	PathTest   string
	PathNew    string
	PathNewApp string

	Time2Int  string
	JsonCamel bool

	basedto.BaseEntity
}

func FindBeanFactroyClientDto added in v1.0.61

func FindBeanFactroyClientDto() *FactroyClientDto

func NewFactroyClientDto added in v1.0.17

func NewFactroyClientDto() *FactroyClientDto

type GatewayDto added in v1.0.14

type GatewayDto struct {
	ByPass []BypassDto `json:"by_pass"`
	Routes []RouteDto  `json:"routes"`

	//- path: /datadict
	//serviceId: web.platform.com
	MapPath2Service map[string]string

	IchubClientDto `json:"-"`
}

func NewGatewayDto added in v1.0.14

func NewGatewayDto() *GatewayDto

func (*GatewayDto) Bypass added in v1.0.22

func (this *GatewayDto) Bypass(path string) bool

func (*GatewayDto) FindServiceName added in v1.0.20

func (this *GatewayDto) FindServiceName(path string) string

func (*GatewayDto) ToMap added in v1.0.20

func (this *GatewayDto) ToMap() *GatewayDto

- path: /datadict serviceId: web.platform.com

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 FindBeanIchubClientDto added in v1.0.61

func FindBeanIchubClientDto() *IchubClientDto

func NewIchubClientDto added in v1.0.61

func NewIchubClientDto() *IchubClientDto

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 NatsClientDto added in v1.0.103

type NatsClientDto struct {
	IchubClientDto

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

func NewNatsClientDto added in v1.0.103

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

func (*RedisClientDto) Parse

func (this *RedisClientDto) Parse() *RedisClientDto

type RegisterTypeDto added in v1.0.22

type RegisterTypeDto struct {
	RegisterType string
	Hosturl      string
}

type RouteDto added in v1.0.14

type RouteDto struct {
	ServiceId string `json:"service_id"`
	Path      string `json:"path"`
}

- path: /datadict serviceId: web.platform.com

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