Documentation
¶
Index ¶
- func DatabaseInstance() apis.DataStorage
- func MakeItemPrefix(serviceId string) string
- func MakePayloadPrefix(serviceId string) string
- func SetDatabase(ds apis.DataStorage)
- type DBService
- func (d *DBService) CacheAllItemData(itemId string, metaData, payload []byte)
- func (d *DBService) CacheItemData(itemId string, itemData []byte)
- func (d *DBService) DeleteAllItemData(itemId string)
- func (d *DBService) InitServiceDB(serviceId string)
- func (d *DBService) ItemIterator() apis.ItemIterator
- func (d *DBService) Payload(itemId string) []byte
- func (d *DBService) WaitFlush()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DatabaseInstance ¶
func DatabaseInstance() apis.DataStorage
GetDatabase returns DataStorage singleton.
func MakeItemPrefix ¶
MakeItemPrefix makes a prefix which will be used to identify to which service item belongs to.
func MakePayloadPrefix ¶
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 ¶
CacheAllItemData stores messages data and payload data into database.
func (*DBService) CacheItemData ¶
CacheItemData stores only message metadata in the database.
func (*DBService) DeleteAllItemData ¶
DeleteAllItemData removes item from database including its payload.
func (*DBService) InitServiceDB ¶
func (*DBService) ItemIterator ¶
func (d *DBService) ItemIterator() apis.ItemIterator
ItemIterator returns an iterator over items which are matching provided prefix.
Click to show internal directories.
Click to hide internal directories.