database

package
v0.0.0-...-4c36365 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UsersCollection    = "users"
	ChatsCollection    = "chats"
	MessagesCollection = "messages"
	AuthCollection     = "user_auth"
)

Functions

func ConfigureCollections

func ConfigureCollections(db *mongo.Database)

func GetMongoDBInstance

func GetMongoDBInstance(uri, dbName string) (*mongo.Database, error)

func GetMongoDBTestInstance

func GetMongoDBTestInstance(callback func(db *mongo.Database))

func GetRedisDBInstance

func GetRedisDBInstance(redisConfigs config.Redis) *redis.Client

func GetRedisTestInstance

func GetRedisTestInstance(callback func(redisClient *redis.Client))

func IsDuplicateKeyError

func IsDuplicateKeyError(err error) bool

func IsRowExistsError

func IsRowExistsError(err error) bool

func NewMongoDBConnectionString

func NewMongoDBConnectionString(host string, port int, username string, password string) string

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