db

package
v0.0.0-...-d19560e Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2018 License: GPL-3.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheDB *badger.DB
View Source
var UserDB *badger.DB

Functions

func CacheMessageEvents

func CacheMessageEvents(id, sender, roomID, message string, timestamp int64) (err error)

CacheMessageEvents writes message infos into the cache into the defined room

func OpenCacheDB

func OpenCacheDB() (db *badger.DB, err error)

OpenCacheDB opens or generates the Database file for settings and Cache

func OpenUserDB

func OpenUserDB() (db *badger.DB, err error)

OpenUserDB opens or generates the Database file for settings and Cache

Types

type MorpheusStorage

type MorpheusStorage struct {
	Database *badger.DB
}

func (*MorpheusStorage) LoadNextBatch

func (m *MorpheusStorage) LoadNextBatch(userID string) (nextBatch string, err error)

LoadNextBatch loads the next_batch token for the given user.

func (*MorpheusStorage) UpdateNextBatch

func (m *MorpheusStorage) UpdateNextBatch(userID, nextBatch string) (err error)

UpdateNextBatch updates the next_batch token for the given user.

type Storer

type Storer interface {
	UpdateNextBatch(userID, nextBatch string) (err error)
	LoadNextBatch(userID string) (nextBatch string, err error)
}

Storer is the interface which needs to be conformed to in order to persist Go-NEB data

Jump to

Keyboard shortcuts

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