Documentation ¶
Index ¶
- type Config
- type Database
- func (d *Database) Close()
- func (d *Database) Connect() error
- func (d *Database) Execute(query string, args ...interface{}) (sql.Result, error)
- func (d *Database) GetJSON(sqlString string) (map[string]interface{}, error)
- func (d *Database) GetJSONList(sqlString string) ([]map[string]interface{}, error)
- func (d *Database) MapScan(query string, args ...interface{}) (map[string]interface{}, error)
- func (d *Database) Ping() error
- func (d *Database) QueryRow(query string, args ...interface{}) *sql.Row
- func (d *Database) SliceMapScan(query string, args ...interface{}) ([]map[string]interface{}, error)
- type DatabaseInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config interface { GetHost() string GetPort() int GetUser() string GetPassword() string GetDatabase() string }
Config Interface With Methods to be a database config
type Database ¶
func (*Database) Close ¶
func (d *Database) Close()
Close is responsible for closing database connection
func (*Database) GetJSONList ¶
GetJSONList Fetch all lines of given select
type DatabaseInterface ¶
type DatabaseInterface interface { Connect() error Ping() error Execute(query string, args ...interface{}) (sql.Result, error) QueryRow(query string, args ...interface{}) *sql.Row GetJSON(sqlString string) (map[string]interface{}, error) MapScan(sqlString string, args ...interface{}) (map[string]interface{}, error) GetJSONList(sqlString string) ([]map[string]interface{}, error) Close() }
Database Interface With Methods to be a database handler
Click to show internal directories.
Click to hide internal directories.