database

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AWS *s3.Client
View Source
var Rdb *redis.Client

Functions

func InitAWS

func InitAWS() error

InitAWS initializes the AWS S3 client and ensures specified buckets exist.

func InitPostgres

func InitPostgres(dsn string) (*sqlx.DB, error)

func InitRedis

func InitRedis() (*redis.Client, error)

func InsertStruct

func InsertStruct(tx *sqlx.Tx, query string, values []interface{}) (uint, error)

InsertStruct inserts a struct into the database and returns the ID

func StructToQuery

func StructToQuery(data interface{}, tableName string) (string, []interface{}, error)

StructToQuery generates an SQL INSERT query from a struct

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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