db

package
v0.0.0-...-bcdc46a Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DatabaseInstance

func DatabaseInstance() apis.DataStorage

GetDatabase returns DataStorage singleton.

func MakeItemPrefix

func MakeItemPrefix(serviceId string) string

MakeItemPrefix makes a prefix which will be used to identify to which service item belongs to.

func MakePayloadPrefix

func MakePayloadPrefix(serviceId string) string

MakePayloadPrefix makes a prefix which will be used to identify to which service payload belongs to.

func SetDatabase

func SetDatabase(ds apis.DataStorage)

Types

type DBService

type DBService struct {
	// contains filtered or unexported fields
}

func (*DBService) CacheAllItemData

func (d *DBService) CacheAllItemData(itemId string, metaData, payload []byte)

CacheAllItemData stores messages data and payload data into database.

func (*DBService) CacheItemData

func (d *DBService) CacheItemData(itemId string, itemData []byte)

CacheItemData stores only message metadata in the database.

func (*DBService) DeleteAllItemData

func (d *DBService) DeleteAllItemData(itemId string)

DeleteAllItemData removes item from database including its payload.

func (*DBService) InitServiceDB

func (d *DBService) InitServiceDB(serviceId string)

func (*DBService) ItemIterator

func (d *DBService) ItemIterator() apis.ItemIterator

ItemIterator returns an iterator over items which are matching provided prefix.

func (*DBService) Payload

func (d *DBService) Payload(itemId string) []byte

Payload returns message payload.

func (*DBService) WaitFlush

func (d *DBService) WaitFlush()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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