conn

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*sql.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) DynamicCount added in v1.0.2

func (db *DB) DynamicCount(builder *gobuilder.GoBuilder) (int, error)

DynamicCount: returns the number of data according to the conditions

func (*DB) DynamicCreate

func (db *DB) DynamicCreate(builder *gobuilder.GoBuilder) (int, error)

DynamicCreate: the specified values are recorded in the specified table.

func (*DB) DynamicFind added in v1.0.2

func (db *DB) DynamicFind(builder *gobuilder.GoBuilder, model any) error

DynamicFind: only renders the first matching record to the p.Model object based on the conditions

func (*DB) DynamicGet added in v1.0.2

func (db *DB) DynamicGet(builder *gobuilder.GoBuilder, model any) ([]any, error)

DynamicGet: returns all records it finds

func (*DB) DynamicPaginate added in v1.0.2

func (db *DB) DynamicPaginate(builder *gobuilder.GoBuilder, model any) ([]any, error)

DynamicPaginate: returns all records according to the conditions

func (*DB) DynamicUpdate

func (db *DB) DynamicUpdate(builder *gobuilder.GoBuilder) error

DynamicUpdate: the values specified in the table are updated.

func (*DB) ExistsInTable

func (db *DB) ExistsInTable(builder *gobuilder.GoBuilder) error

ExistsInTable: If exists, return "nil".

func (*DB) HardDelete added in v1.0.2

func (db *DB) HardDelete(builder *gobuilder.GoBuilder) error

HardDelete: hard delete the specified id in the specified table.

func (*DB) NotExistsInTable

func (db *DB) NotExistsInTable(builder *gobuilder.GoBuilder) error

NotExistsInTable: If not exists, return "nil".

func (*DB) QueryExec

func (db *DB) QueryExec(builder *gobuilder.GoBuilder) error

QueryExec: returns nil if the query is executed successfully

func (*DB) SoftDelete

func (db *DB) SoftDelete(builder *gobuilder.GoBuilder) error

SoftDelete: soft delete the specified id in the specified table.

type Kafka

type Kafka struct {
	sarama.SyncProducer
}

func (*Kafka) CloseKafka

func (k *Kafka) CloseKafka()

func (*Kafka) ConnectKafka added in v1.1.1

func (k *Kafka) ConnectKafka()

func (*Kafka) PushCommentToQueue

func (k *Kafka) PushCommentToQueue(topic string, message []byte) error

type Redis

type Redis struct {
	*redis.Client
}

func (*Redis) CloseRedis

func (r *Redis) CloseRedis()

func (*Redis) ConnectRedis

func (r *Redis) ConnectRedis()

func (*Redis) RedisRead

func (r *Redis) RedisRead() (string, error)

func (*Redis) RedisWrite

func (r *Redis) RedisWrite() error

Jump to

Keyboard shortcuts

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