Documentation ¶
Index ¶
- type DB
- func (db *DB) CloseDatabase()
- func (db *DB) ConnectDatabase()
- func (db *DB) CountInTable(table string, conditions map[string]any) (int, error)
- func (db *DB) DynamicCreate(table string, fields map[string]any) error
- func (db *DB) DynamicUpdate(table string, updates map[string]any, conditions map[string]any) error
- func (db *DB) ExistsInTable(table string, conditions map[string]any) error
- func (db *DB) NotExistsInTable(table string, conditions map[string]any) error
- func (db *DB) QueryExec(query string, params []any) error
- func (db *DB) RunPrepare(exec any, query string, args ...any) (*sql.Stmt, error)
- func (db *DB) SoftDelete(id int, table string) error
- type Kafka
- type Redis
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
func (*DB) CloseDatabase ¶
func (db *DB) CloseDatabase()
CloseDatabase method is closing a connection between your app and your db
func (*DB) ConnectDatabase ¶
func (db *DB) ConnectDatabase()
ConnectDatabase is creating a new connection to our database
func (*DB) CountInTable ¶
CountInTable: returns the number of data according to the conditions
func (*DB) DynamicCreate ¶
DynamicCreate: the specified values are recorded in the specified table.
func (*DB) DynamicUpdate ¶
DynamicUpdate: the values specified in the table are updated.
func (*DB) ExistsInTable ¶
ExistsInTable: If exists, I should get a “nil” return.
func (*DB) NotExistsInTable ¶
NotExistsInTable: If not exists, I should get a “nil” return.
func (*DB) RunPrepare ¶
type Kafka ¶
type Kafka struct {
sarama.SyncProducer
}
func (*Kafka) CloseKafka ¶
func (k *Kafka) CloseKafka()
Click to show internal directories.
Click to hide internal directories.