Documentation
¶
Overview ¶
Package botstorage contains gotd storage implementations for Telegram bots.
Index ¶
- type BBoltStorage
- func (b *BBoltStorage) Find(_ context.Context, key peers.Key) (value peers.Value, found bool, err error)
- func (b *BBoltStorage) FindChannel(_ context.Context, id int64) (e *tg.Channel, found bool, err error)
- func (b *BBoltStorage) FindChannelFull(_ context.Context, id int64) (e *tg.ChannelFull, found bool, err error)
- func (b *BBoltStorage) FindChat(_ context.Context, id int64) (e *tg.Chat, found bool, err error)
- func (b *BBoltStorage) FindChatFull(_ context.Context, id int64) (e *tg.ChatFull, found bool, err error)
- func (b *BBoltStorage) FindPhone(_ context.Context, phone string) (key peers.Key, value peers.Value, found bool, err error)
- func (b *BBoltStorage) FindUser(_ context.Context, id int64) (e *tg.User, found bool, err error)
- func (b *BBoltStorage) FindUserFull(_ context.Context, id int64) (e *tg.UserFull, found bool, err error)
- func (b *BBoltStorage) ForEachChannels(ctx context.Context, _ int64, ...) error
- func (b *BBoltStorage) GetChannelPts(_ context.Context, _, channelID int64) (pts int, found bool, err error)
- func (b *BBoltStorage) GetContactsHash(ctx context.Context) (int64, error)
- func (b *BBoltStorage) GetState(_ context.Context, _ int64) (state updates.State, found bool, err error)
- func (b *BBoltStorage) LoadSession(_ context.Context) (data []byte, err error)
- func (b *BBoltStorage) Save(_ context.Context, key peers.Key, value peers.Value) error
- func (b *BBoltStorage) SaveChannelFulls(_ context.Context, channels ...*tg.ChannelFull) error
- func (b *BBoltStorage) SaveChannels(_ context.Context, channels ...*tg.Channel) error
- func (b *BBoltStorage) SaveChatFulls(_ context.Context, chats ...*tg.ChatFull) error
- func (b *BBoltStorage) SaveChats(_ context.Context, chats ...*tg.Chat) error
- func (b *BBoltStorage) SaveContactsHash(_ context.Context, hash int64) error
- func (b *BBoltStorage) SavePhone(_ context.Context, phone string, key peers.Key) error
- func (b *BBoltStorage) SaveUserFulls(_ context.Context, users ...*tg.UserFull) error
- func (b *BBoltStorage) SaveUsers(_ context.Context, users ...*tg.User) error
- func (b *BBoltStorage) SetChannelPts(_ context.Context, _, channelID int64, pts int) error
- func (b *BBoltStorage) SetDate(_ context.Context, _ int64, date int) error
- func (b *BBoltStorage) SetDateSeq(_ context.Context, _ int64, date, seq int) error
- func (b *BBoltStorage) SetPts(_ context.Context, _ int64, pts int) error
- func (b *BBoltStorage) SetQts(_ context.Context, _ int64, qts int) error
- func (b *BBoltStorage) SetSeq(_ context.Context, _ int64, seq int) error
- func (b *BBoltStorage) SetState(_ context.Context, _ int64, state updates.State) error
- func (b *BBoltStorage) StoreSession(_ context.Context, data []byte) error
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) 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) 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) SaveChannelFulls ¶
func (b *BBoltStorage) SaveChannelFulls(_ context.Context, channels ...*tg.ChannelFull) error
SaveChannelFulls implements BBoltStorage.
func (*BBoltStorage) SaveChannels ¶
SaveChannels implements BBoltStorage.
func (*BBoltStorage) SaveChatFulls ¶
SaveChatFulls implements BBoltStorage.
func (*BBoltStorage) SaveContactsHash ¶
func (b *BBoltStorage) SaveContactsHash(_ context.Context, hash int64) error
SaveContactsHash implements peers.Storage.
func (*BBoltStorage) SaveUserFulls ¶
SaveUserFulls implements BBoltStorage.
func (*BBoltStorage) SetChannelPts ¶
SetChannelPts implements updates.StateStorage.
func (*BBoltStorage) SetDateSeq ¶
SetDateSeq implements updates.StateStorage.
func (*BBoltStorage) StoreSession ¶
func (b *BBoltStorage) StoreSession(_ context.Context, data []byte) error
StoreSession implements session.Storage.