types

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeforStartCallback

type BeforStartCallback func(c core.Container)

type DBConfig

type DBConfig struct {
	Debug       bool   `mapstructure:"debug"`
	DefaultConn string `mapstructure:"default_conn"`
	// 以下配置关于 dsn
	WriteTimeout string `mapstructure:"write_timeout"` // 写超时时间
	Loc          string `mapstructure:"loc"`           // 时区
	Port         int    `mapstructure:"port"`          // 端口
	ReadTimeout  string `mapstructure:"read_timeout"`  // 读超时时间
	Charset      string `mapstructure:"charset"`       // 字符集
	ParseTime    bool   `mapstructure:"parse_time"`    // 是否解析时间
	Protocol     string `mapstructure:"protocol"`      // 传输协议
	Database     string `mapstructure:"database"`      // 数据库
	Collation    string `mapstructure:"collation"`     // 字符序
	Timeout      string `mapstructure:"timeout"`       // 连接超时时间
	Username     string `mapstructure:"username"`      // 用户名
	Password     string `mapstructure:"password"`      // 密码
	Driver       string `mapstructure:"driver"`        // 驱动
	Host         string `mapstructure:"host"`          // 数据库地址

	// 以下配置关于连接池
	ConnMaxIdle     int    `mapstructure:"conn_max_idle"`     // 最大空闲连接数
	ConnMaxOpen     int    `mapstructure:"conn_max_open"`     // 最大连接数
	ConnMaxLifetime string `mapstructure:"conn_max_lifetime"` // 连接最大生命周期
	ConnMaxIdletime string `mapstructure:"conn_max_idletime"` // 空闲最大生命周期
}

DBConfig 代表数据库连接的所有配置

type DiscoveryClient

type DiscoveryClient struct {
	ServiceName string `mapstructure:"service_name"`
	ServiceAddr string `mapstructure:"service_addr"`
}

type DiscoveryServer

type DiscoveryServer struct {
	Endpoints         []string `mapstructure:"endpoints"`
	DialTimeoutSecods int      `mapstructure:"dial_timeout_secods"`
}

type EtcdConfig

type EtcdConfig struct {
	DiscoveryIntervalSeconds int `mapstructure:"discovery_interval_seconds"`
	Server                   DiscoveryServer
	Client                   DiscoveryClient
}

discovery

type GetServicesDTO

type GetServicesDTO struct {
	List []string
}

type Goodlog

type Goodlog struct {
	Level string
}

logger 配置

type RedisConfig

type RedisConfig struct {
	Addr     string
	Password string
	Db       int
}

Redis 配置

type SwaggerConfig

type SwaggerConfig struct {
	FilePath      string `mapstructure:"filepath"`
	SwaggerUiHost string `mapstructure:"host"`
	SwaggerUiPort int    `mapstructure:"port"`
}

swagger 配置

Jump to

Keyboard shortcuts

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