Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FlyDatabaseInterface ¶
type FlyDatabaseInterface interface {
Open(settings *FlyDatabaseSettings) error
AddTable(table interface{}) error
GetDB() *gorm.DB
GetSettings() *FlyDatabaseSettings
}
type FlyDatabaseSettings ¶
type FlyDatabaseSettings struct {
Enable bool
ConfigType string
ConfigKey string
Type string
Debug bool
LogMode logger.LogLevel //Silent, Error, Warn, Info
Ready bool
//for sqlite
FileName string
//for mysql
Host string
Port int
User string
Password string
Database string
Charset string
MaxIdleConns int
MaxOpenConns int
DSN string
}
func NewFlyDatabaseSettings ¶
func NewFlyDatabaseSettings(config *FlyConfigFile.FlyIni, key string) (*FlyDatabaseSettings, error)
func (*FlyDatabaseSettings) LoadIni ¶
func (s *FlyDatabaseSettings) LoadIni(config *FlyConfigFile.FlyIni, key string) error
从ini加载配置信息
func (*FlyDatabaseSettings) TypeIs ¶
func (s *FlyDatabaseSettings) TypeIs(typename string) bool
type FlyDatabaseSettingsSqlite ¶
type FlyDatabaseSettingsSqlite struct {
}
type FlyMySQL ¶
type FlyMySQL struct {
Settings *FlyDatabaseSettings
DB *gorm.DB
Ready bool
}
func NewFlyMySQL ¶
func NewFlyMySQL(settings *FlyDatabaseSettings) (*FlyMySQL, error)
func (*FlyMySQL) GetSettings ¶
func (s *FlyMySQL) GetSettings() *FlyDatabaseSettings
func (*FlyMySQL) Open ¶
func (s *FlyMySQL) Open(settings *FlyDatabaseSettings) error
type FlySqlite ¶
type FlySqlite struct {
Settings *FlyDatabaseSettings
DB *gorm.DB
Ready bool
}
func NewFlySqlite ¶
func NewFlySqlite(settings *FlyDatabaseSettings) (*FlySqlite, error)
func (*FlySqlite) GetSettings ¶
func (s *FlySqlite) GetSettings() *FlyDatabaseSettings
func (*FlySqlite) Open ¶
func (s *FlySqlite) Open(settings *FlyDatabaseSettings) error
Click to show internal directories.
Click to hide internal directories.