Documentation
¶
Index ¶
- type DB
- func (db *DB) GetAllOffices() ([]types.Office, error)
- func (db *DB) GetAllProducts() ([]types.Product, error)
- func (db *DB) GetRandomOffice() (types.Office, error)
- func (db *DB) GetRandomProduct() (types.Product, error)
- func (db *DB) InsertOffice(office types.Office) error
- func (db *DB) InsertProduct(product types.Product) error
- func (db *DB) InsertTicket(ticket types.Ticket) (int, error)
- type DBConnectionConfig
- func (config DBConnectionConfig) WithDatabaseDriver(driver string) DBConnectionConfig
- func (config DBConnectionConfig) WithDatabaseName(name string) DBConnectionConfig
- func (config DBConnectionConfig) WithHost(host string) DBConnectionConfig
- func (config DBConnectionConfig) WithPassword(password string) DBConnectionConfig
- func (config DBConnectionConfig) WithPort(port string) DBConnectionConfig
- func (config DBConnectionConfig) WithQueryBufferSize(size uint8) DBConnectionConfig
- func (config DBConnectionConfig) WithUser(user string) DBConnectionConfig
- type QueryExecutor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
Connection *sqlx.DB
QueryBuffer chan QueryExecutor
}
func NewDBConnection ¶
func NewDBConnection(config DBConnectionConfig) (*DB, error)
func NewDefaultDBConnection ¶
type DBConnectionConfig ¶
type DBConnectionConfig struct {
DatabaseDriver string
DatabaseName string
Host string
Password string
Port string
QueryBufferSize uint8
User string
}
func NewDBConnectionConfig ¶
func NewDBConnectionConfig() DBConnectionConfig
func (DBConnectionConfig) WithDatabaseDriver ¶
func (config DBConnectionConfig) WithDatabaseDriver(driver string) DBConnectionConfig
func (DBConnectionConfig) WithDatabaseName ¶
func (config DBConnectionConfig) WithDatabaseName(name string) DBConnectionConfig
func (DBConnectionConfig) WithHost ¶
func (config DBConnectionConfig) WithHost(host string) DBConnectionConfig
func (DBConnectionConfig) WithPassword ¶
func (config DBConnectionConfig) WithPassword(password string) DBConnectionConfig
func (DBConnectionConfig) WithPort ¶
func (config DBConnectionConfig) WithPort(port string) DBConnectionConfig
func (DBConnectionConfig) WithQueryBufferSize ¶
func (config DBConnectionConfig) WithQueryBufferSize(size uint8) DBConnectionConfig
func (DBConnectionConfig) WithUser ¶
func (config DBConnectionConfig) WithUser(user string) DBConnectionConfig
type QueryExecutor ¶
Click to show internal directories.
Click to hide internal directories.