FlyDatabase

package
v0.0.0-...-482d8b5 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

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) AddTable

func (s *FlyMySQL) AddTable(table interface{}) error

func (*FlyMySQL) GetDB

func (s *FlyMySQL) GetDB() *gorm.DB

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) AddTable

func (s *FlySqlite) AddTable(table interface{}) error

func (*FlySqlite) GetDB

func (s *FlySqlite) GetDB() *gorm.DB

func (*FlySqlite) GetSettings

func (s *FlySqlite) GetSettings() *FlyDatabaseSettings

func (*FlySqlite) Open

func (s *FlySqlite) Open(settings *FlyDatabaseSettings) error

Jump to

Keyboard shortcuts

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