Documentation ¶
Index ¶
Constants ¶
View Source
const Profile = "gorm"
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Config ¶
type DataSource ¶
type DataSource interface { Open(p *Properties) error IsOpened() bool Close() error Repository() gorm.Repository }
func GetDataSource ¶
func GetDataSource() DataSource
type Properties ¶ added in v1.3.0
type Properties struct { // annotation ConfigurationProperties at.ConfigurationProperties `value:"gorm"` Type string `json:"type" default:"mysql"` // mysql, postgres, sqlite3, mssql, Host string `json:"host" default:"mysql-dev"` Port string `json:"port" default:"3306"` Database string `json:"database"` Username string `json:"username"` Password string `json:"password"` Charset string `json:"charset" default:"utf8"` ParseTime bool `json:"parse_time" default:"true"` Loc string `json:"loc" default:"Asia/Shanghai"` Config Config `json:"config"` ConnMaxLifetime string `json:"connMaxLifetime" default:"60s"` MaxIdleConns int `json:"maxIdle_conns" default:"20"` MaxOpenConns int `json:"maxOpen_conns" default:"200"` AutoReconnect bool `json:"auto_reconnect" default:"true"` RetryTimes int `json:"retry_times" default:"-1"` Interval string `json:"interval" default:"3s"` NowRetryTimes int `json:"now_retry_times" default:"0"` }
type Repository ¶
type Repository interface { gorm.Repository }
Click to show internal directories.
Click to hide internal directories.