middleware

package
v0.0.0-...-32326d8 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBRootPath   = "/tmp"
	DBFilename   = "data.json"
	DBBucketName = "todolist"
)

Variables

View Source
var Database *badger.DB
View Source
var MongoDatabase *mongo.Client
View Source
var MongoTodoCollection *mongo.Collection

Functions

func DeleteItemByKey

func DeleteItemByKey(key []byte) error

func GetItemByKey

func GetItemByKey(key []byte) ([]byte, error)

func InitBadgerDB

func InitBadgerDB() error

func InitMongoDB

func InitMongoDB(connectionString string)

create connection with mongo db

func MongoDeleteData

func MongoDeleteData(id string) error

func MongoFindDataByID

func MongoFindDataByID(id string) models.TodoMongoTask

func MongoGetAllData

func MongoGetAllData() (models.TodoMongo, error)

func MongoNewData

func MongoNewData(task *models.TodoMongoTask) error

func MongoPurgeAllData

func MongoPurgeAllData() error

func MongoUpdateData

func MongoUpdateData(updatedData bson.M, id string) error

func NewItemForKey

func NewItemForKey(key, value []byte) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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