db

package
v0.0.0-...-d6774cb Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Ctx = context.TODO()
)

Functions

This section is empty.

Types

type MongoDB

type MongoDB struct {
	MongoClient *mongo.Client
}

func ConnectMongoDB

func ConnectMongoDB() (*MongoDB, error)

Create a mongodb clients

func (*MongoDB) FetchDataFromMongoDB

func (db *MongoDB) FetchDataFromMongoDB(startTime time.Time, endTime time.Time, minCount int, maxCount int) ([]models.FetchRecordsArrayModel, string, int)

Fetches data from MongoDB

type RedisDatabase

type RedisDatabase struct {
	Client *redis.Client
}

func NewRedisDatabase

func NewRedisDatabase() (*RedisDatabase, error)

Creates a new redis client

func (*RedisDatabase) GetKeyFromRedis

func (db *RedisDatabase) GetKeyFromRedis(key string) ([]byte, int)

Gets the value using its key from redis

func (*RedisDatabase) InsertKeyToRedis

func (db *RedisDatabase) InsertKeyToRedis(key string, value string) string

Insert a key value pair to redis

Jump to

Keyboard shortcuts

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