Documentation
¶
Index ¶
- type Config
- func (c *Config) GetDatabase(version, dbID int64, tableName string) Database
- func (c *Config) GetDefaultDatabse() Database
- func (c *Config) GetLastVersionEntity(entityName string) Table
- func (c *Config) GetNewestVersion() Version
- func (c *Config) GetSpecificVersion(version int64) Version
- func (c *Config) String() string
- func (c *Config) Validate() bool
- type Database
- func (n Database) ConnStr() (string, error)
- func (d *Database) IsNullObject() bool
- func (d *Database) SetMaxConns(connAmout int)
- func (d *Database) SetMaxLifeTime(duration time.Duration)
- func (d *Database) SetMinConns(connAmout int)
- func (n *Database) String() string
- func (d *Database) Validate() bool
- type IValidate
- type Rule
- type Table
- type Tag
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Database Database `yaml:"database"`
Versions []Version `yaml:"versions"`
// contains filtered or unexported fields
}
func (*Config) GetDatabase ¶
func (*Config) GetDefaultDatabse ¶
func (*Config) GetLastVersionEntity ¶
func (*Config) GetNewestVersion ¶
func (*Config) GetSpecificVersion ¶
type Database ¶
type Database struct {
DSN string `yaml:"dsn"`
Passwd string `yaml:"passwd"`
MaxConns int `yaml:"max_conns"`
MinConns int `yaml:"min_conns"`
MaxLifeTIme time.Duration `yaml:"max_lifetime"`
}
func (*Database) IsNullObject ¶
func (*Database) SetMaxConns ¶
func (*Database) SetMaxLifeTime ¶
func (*Database) SetMinConns ¶
type Table ¶
type Table struct {
Name string `yaml:name`
Tags []Tag `yaml:tags`
Key string `yaml:key`
TimeZone string `yaml:"timeZone"`
}
func (*Table) IsEmptyTimeZone ¶
func (*Table) IsNullObject ¶
type Tag ¶
type Tag struct {
ID int `yaml:"id"`
Names []string `yaml:names`
Amount int `yaml:"amount"`
Date string `yaml:"date,omitempty"`
// contains filtered or unexported fields
}
func (*Tag) GetHashValue ¶
func (*Tag) GetIdString ¶
func (*Tag) IsNullObject ¶
Click to show internal directories.
Click to hide internal directories.