badger

package
v1.9.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IdsDB

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

IdsDB represents a Badger database

func IdsDBOpen

func IdsDBOpen(path string) IdsDB

IdsDBOpen returns a new DB object

func (*IdsDB) Close

func (db *IdsDB) Close()

Close closes a DB

func (*IdsDB) Gc

func (db *IdsDB) Gc()

Gc compacts the value log

func (*IdsDB) GetByTgIds

func (db *IdsDB) GetByTgIds(tgAccount, xmppAccount string, tgChatId, tgMsgId int64) (string, error)

GetByTgIds obtains an XMPP id by Telegram chat/message ids

func (*IdsDB) GetByXmppId

func (db *IdsDB) GetByXmppId(tgAccount, xmppAccount, xmppId string) (int64, int64, error)

GetByXmppId obtains Telegram chat/message ids by an XMPP id

func (*IdsDB) ReplaceIdPair

func (db *IdsDB) ReplaceIdPair(tgAccount, xmppAccount, oldXmppId, newXmppId string, newMsgId int64) error

ReplaceIdPair replaces an old entry by XMPP ID with both new XMPP and Tg ID

func (*IdsDB) ReplaceTgId

func (db *IdsDB) ReplaceTgId(tgAccount, xmppAccount string, chatId, oldMsgId, newMsgId int64) error

ReplaceTgId replaces an old Tg ID with new Tg ID and keeps Tg chat ID and XMPP ID intact

func (*IdsDB) ReplaceXmppId

func (db *IdsDB) ReplaceXmppId(tgAccount, xmppAccount, oldXmppId, newXmppId string) error

ReplaceXmppId replaces an old XMPP ID with new XMPP ID and keeps Tg ID intact

func (*IdsDB) Set

func (db *IdsDB) Set(tgAccount, xmppAccount string, tgChatId, tgMsgId int64, xmppId string) error

Set stores an id pair

Jump to

Keyboard shortcuts

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