Documentation
¶
Index ¶
- Constants
- Variables
- func GetConfig[T any]() *T
- func NewInit(conf Config, dao Dao) *initConfig
- func ParseTagSetting(str string, sep string, settings TagSettings, tags []string)
- func Start(conf Config, dao Dao, notinit ...string) func(deferf ...func())
- func Unmarshal(v reflect.Value) error
- type AfterSet
- type BasicConfig
- type CloseFunc
- type Config
- type ConfigCenterConfig
- type ConfigTagSettings
- type Dao
- type DaoConfig
- type DaoEntity
- type DaoField
- type DaoFieldCloser
- type DaoFieldCloser1
- type DaoTagSettings
- type Env
- type FileConfig
- type FlagConfig
- type Generate
- type NeedInit
- type NeedInitPlaceholder
- type PreSet
- type TagSettings
Constants ¶
View Source
const ( DEVELOPMENT = "dev" TEST = "test" PRODUCT = "prod" InitKey = "initialize" )
View Source
const ( EntityField = "ENTITY" ConfigField = "CONFIG" )
Variables ¶
View Source
var ( // 此处不是真正的初始化,只是为了让配置中心能够读取到配置 InitConfig = &initConfig{ Env: DEVELOPMENT, ConfUrl: "./config.toml", } )
约定大于配置
Functions ¶
func ParseTagSetting ¶
func ParseTagSetting(str string, sep string, settings TagSettings, tags []string)
ParseTagSetting default sep ;
Types ¶
type BasicConfig ¶
type BasicConfig struct {
Module string
}
type ConfigCenterConfig ¶
type ConfigCenterConfig struct {
NoInject []string
conf_center.ConfigCenterConfig
}
type ConfigTagSettings ¶
func ParseConfigTagSettings ¶
func ParseConfigTagSettings(str string) *ConfigTagSettings
func (*ConfigTagSettings) Set ¶
func (c *ConfigTagSettings) Set(index int, value string)
type DaoEntity ¶
type DaoFieldCloser ¶
type DaoFieldCloser1 ¶
type DaoFieldCloser1 interface {
Close()
}
type DaoTagSettings ¶
func ParseDaoTagSettings ¶
func ParseDaoTagSettings(str string) *DaoTagSettings
func (*DaoTagSettings) Set ¶
func (t *DaoTagSettings) Set(index int, value string)
type FileConfig ¶
type FileConfig struct {
BasicConfig
Dev, Test, Prod *ConfigCenterConfig
}
type NeedInitPlaceholder ¶
type NeedInitPlaceholder struct {
}
type TagSettings ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.