botstorage

package
v0.0.0-...-aa11ac5 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package botstorage contains gotd storage implementations for Telegram bots.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BBoltStorage

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

BBoltStorage is bbolt-based storage.

func NewBBoltStorage

func NewBBoltStorage(db *bbolt.DB) *BBoltStorage

NewBBoltStorage creates new BBoltStorage.

func (*BBoltStorage) Find

func (b *BBoltStorage) Find(_ context.Context, key peers.Key) (value peers.Value, found bool, err error)

Find implements peers.Storage.

func (*BBoltStorage) FindChannel

func (b *BBoltStorage) FindChannel(_ context.Context, id int64) (e *tg.Channel, found bool, err error)

FindChannel implements BBoltStorage.

func (*BBoltStorage) FindChannelFull

func (b *BBoltStorage) FindChannelFull(_ context.Context, id int64) (e *tg.ChannelFull, found bool, err error)

FindChannelFull implements BBoltStorage.

func (*BBoltStorage) FindChat

func (b *BBoltStorage) FindChat(_ context.Context, id int64) (e *tg.Chat, found bool, err error)

FindChat implements BBoltStorage.

func (*BBoltStorage) FindChatFull

func (b *BBoltStorage) FindChatFull(_ context.Context, id int64) (e *tg.ChatFull, found bool, err error)

FindChatFull implements BBoltStorage.

func (*BBoltStorage) FindPhone

func (b *BBoltStorage) FindPhone(_ context.Context, phone string) (key peers.Key, value peers.Value, found bool, err error)

FindPhone implements peers.Storage.

func (*BBoltStorage) FindUser

func (b *BBoltStorage) FindUser(_ context.Context, id int64) (e *tg.User, found bool, err error)

FindUser implements BBoltStorage.

func (*BBoltStorage) FindUserFull

func (b *BBoltStorage) FindUserFull(_ context.Context, id int64) (e *tg.UserFull, found bool, err error)

FindUserFull implements BBoltStorage.

func (*BBoltStorage) ForEachChannels

func (b *BBoltStorage) ForEachChannels(ctx context.Context, _ int64, f func(_ context.Context, channelID int64, pts int) error) error

ForEachChannels implements updates.StateStorage.

func (*BBoltStorage) GetChannelPts

func (b *BBoltStorage) GetChannelPts(_ context.Context, _, channelID int64) (pts int, found bool, err error)

GetChannelPts implements updates.StateStorage.

func (*BBoltStorage) GetContactsHash

func (b *BBoltStorage) GetContactsHash(ctx context.Context) (int64, error)

GetContactsHash implements peers.Storage.

func (*BBoltStorage) GetState

func (b *BBoltStorage) GetState(_ context.Context, _ int64) (state updates.State, found bool, err error)

GetState implements updates.StateStorage.

func (*BBoltStorage) LoadSession

func (b *BBoltStorage) LoadSession(_ context.Context) (data []byte, err error)

LoadSession implements session.Storage.

func (*BBoltStorage) Save

func (b *BBoltStorage) Save(_ context.Context, key peers.Key, value peers.Value) error

Save implements peers.Storage.

func (*BBoltStorage) SaveChannelFulls

func (b *BBoltStorage) SaveChannelFulls(_ context.Context, channels ...*tg.ChannelFull) error

SaveChannelFulls implements BBoltStorage.

func (*BBoltStorage) SaveChannels

func (b *BBoltStorage) SaveChannels(_ context.Context, channels ...*tg.Channel) error

SaveChannels implements BBoltStorage.

func (*BBoltStorage) SaveChatFulls

func (b *BBoltStorage) SaveChatFulls(_ context.Context, chats ...*tg.ChatFull) error

SaveChatFulls implements BBoltStorage.

func (*BBoltStorage) SaveChats

func (b *BBoltStorage) SaveChats(_ context.Context, chats ...*tg.Chat) error

SaveChats implements BBoltStorage.

func (*BBoltStorage) SaveContactsHash

func (b *BBoltStorage) SaveContactsHash(_ context.Context, hash int64) error

SaveContactsHash implements peers.Storage.

func (*BBoltStorage) SavePhone

func (b *BBoltStorage) SavePhone(_ context.Context, phone string, key peers.Key) error

SavePhone implements peers.Storage.

func (*BBoltStorage) SaveUserFulls

func (b *BBoltStorage) SaveUserFulls(_ context.Context, users ...*tg.UserFull) error

SaveUserFulls implements BBoltStorage.

func (*BBoltStorage) SaveUsers

func (b *BBoltStorage) SaveUsers(_ context.Context, users ...*tg.User) error

SaveUsers implements BBoltStorage.

func (*BBoltStorage) SetChannelPts

func (b *BBoltStorage) SetChannelPts(_ context.Context, _, channelID int64, pts int) error

SetChannelPts implements updates.StateStorage.

func (*BBoltStorage) SetDate

func (b *BBoltStorage) SetDate(_ context.Context, _ int64, date int) error

SetDate implements updates.StateStorage.

func (*BBoltStorage) SetDateSeq

func (b *BBoltStorage) SetDateSeq(_ context.Context, _ int64, date, seq int) error

SetDateSeq implements updates.StateStorage.

func (*BBoltStorage) SetPts

func (b *BBoltStorage) SetPts(_ context.Context, _ int64, pts int) error

SetPts implements updates.StateStorage.

func (*BBoltStorage) SetQts

func (b *BBoltStorage) SetQts(_ context.Context, _ int64, qts int) error

SetQts implements updates.StateStorage.

func (*BBoltStorage) SetSeq

func (b *BBoltStorage) SetSeq(_ context.Context, _ int64, seq int) error

SetSeq implements updates.StateStorage.

func (*BBoltStorage) SetState

func (b *BBoltStorage) SetState(_ context.Context, _ int64, state updates.State) error

SetState implements updates.StateStorage.

func (*BBoltStorage) StoreSession

func (b *BBoltStorage) StoreSession(_ context.Context, data []byte) error

StoreSession implements session.Storage.

Jump to

Keyboard shortcuts

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