database

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheDB

type CacheDB struct {
	IDatabase
	// contains filtered or unexported fields
}

func ConnectWithCacheDB

func ConnectWithCacheDB(config *settings.CacheDbConf) (*CacheDB, error)

func (*CacheDB) Delete

func (r *CacheDB) Delete(key string) (bool, error)

func (*CacheDB) Exists

func (r *CacheDB) Exists(key string) bool

func (*CacheDB) Get

func (r *CacheDB) Get(key string) ([]byte, error)

func (*CacheDB) GetClient

func (r *CacheDB) GetClient() redis.Conn

func (*CacheDB) LikeDeletes

func (r *CacheDB) LikeDeletes(key string) error

func (*CacheDB) SetString

func (r *CacheDB) SetString(key string, data string, time int) error

type DocDB

type DocDB struct {
	IDatabase
	// contains filtered or unexported fields
}

func ConnectWithDocDB

func ConnectWithDocDB(config *settings.DocDbConf) (*DocDB, error)

func (*DocDB) Database

func (db *DocDB) Database(dbname string) *mongo.Database

func (*DocDB) GetClient

func (db *DocDB) GetClient() *mongo.Client

func (*DocDB) ListIndexes

func (db *DocDB) ListIndexes(database, collection string)

func (*DocDB) PopulateIndex

func (db *DocDB) PopulateIndex(database, collection, key string, sort int32, unique bool)

func (*DocDB) PopulateMultiIndex

func (db *DocDB) PopulateMultiIndex(database, collection string, keys []string, sorts []int32, unique bool)

func (*DocDB) PopulateTTLIndex

func (db *DocDB) PopulateTTLIndex(database, collection, key string, sort int32, unique bool, ttl int32)

type IDatabase

type IDatabase interface {
	GetClient()
	// contains filtered or unexported methods
}

type RDB

type RDB struct {
	IDatabase
	// contains filtered or unexported fields
}

func ConnectWithRDB

func ConnectWithRDB(conf *settings.RDBConf) (rdb *RDB, err error)

func (*RDB) GetClient

func (rdb *RDB) GetClient(dbName string) (*gorm.DB, error)

Jump to

Keyboard shortcuts

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