Documentation
¶
Index ¶
- Variables
- type CoreDatabase
- type Instance
- func (i *Instance) CloseConnection() error
- func (i *Instance) GetConfig() *InstanceConfig
- func (i *Instance) GetSQL() (*sql.DB, error)
- func (i *Instance) IsConnected() bool
- func (i *Instance) Ping() error
- func (i *Instance) SetConfig(cfg *InstanceConfig) error
- func (i *Instance) SetConnected(v bool)
- func (i *Instance) SetMySQLConnection(con *sql.DB) error
- func (i *Instance) SetPostgresConnection(con *sql.DB) error
- func (i *Instance) SetSQLiteConnection(con *sql.DB) error
- type InstanceConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // CoreDB Global CoreDB Connection CoreDB = &Instance{} // CoinbaseDB Global CoreDB Connection CoinbaseDB = &Instance{} // TDAmeritradeDB Global CoreDB Connection TDAmeritradeDB = &Instance{} )
Functions ¶
This section is empty.
Types ¶
type CoreDatabase ¶
type CoreDatabase struct {
*Instance
}
func (*CoreDatabase) GetUserByUsername ¶
func (db *CoreDatabase) GetUserByUsername(username string) (*models.User, error)
type Instance ¶
Instance holds all information for a single database instance
func (*Instance) CloseConnection ¶
CloseConnection safely disconnects the global database instance
func (*Instance) GetConfig ¶
func (i *Instance) GetConfig() *InstanceConfig
GetConfig safely returns a copy of the config
func (*Instance) IsConnected ¶
IsConnected safely checks the SQL connection status
func (*Instance) SetConfig ¶
func (i *Instance) SetConfig(cfg *InstanceConfig) error
SetConfig safely sets the global database instance's config
func (*Instance) SetConnected ¶
SetConnected safely sets the global database instance's connected status
func (*Instance) SetMySQLConnection ¶
SetMySQLConnection safely sets the global database instance's connection to use SQLite
func (*Instance) SetPostgresConnection ¶
SetPostgresConnection safely sets the global database instance's connection to use Postgres
type InstanceConfig ¶
Click to show internal directories.
Click to hide internal directories.