Documentation ¶
Index ¶
- Variables
- type Container
- type ScopedStore
- func (s *ScopedStore) DeleteAccessHashesForUser(ctx context.Context) (err error)
- func (s *ScopedStore) DeleteChannelStateForUser(ctx context.Context) (err error)
- func (s *ScopedStore) DeleteUserState(ctx context.Context) (err error)
- func (s *ScopedStore) ForEachChannels(ctx context.Context, userID int64, ...) error
- func (s *ScopedStore) GetAccessHash(ctx context.Context, entityType ids.PeerType, entityID int64) (accessHash int64, err error)
- func (s *ScopedStore) GetChannelAccessHash(ctx context.Context, forUserID, channelID int64) (accessHash int64, found bool, err error)deprecated
- func (s *ScopedStore) GetChannelPts(ctx context.Context, userID int64, channelID int64) (pts int, found bool, err error)
- func (s *ScopedStore) GetEntityIDByUsername(ctx context.Context, username string) (entityType ids.PeerType, entityID int64, err error)
- func (s *ScopedStore) GetState(ctx context.Context, userID int64) (state updates.State, found bool, err error)
- func (s *ScopedStore) GetUserAccessHash(ctx context.Context, forUserID int64, userID int64) (accessHash int64, found bool, err error)deprecated
- func (s *ScopedStore) GetUserIDByPhoneNumber(ctx context.Context, phoneNumber string) (userID int64, err error)
- func (s *ScopedStore) GetUsername(ctx context.Context, entityType ids.PeerType, userID int64) (username string, err error)
- func (s *ScopedStore) SetAccessHash(ctx context.Context, entityType ids.PeerType, entityID, accessHash int64) (err error)
- func (s *ScopedStore) SetChannelAccessHash(ctx context.Context, forUserID, channelID, accessHash int64) (err error)deprecated
- func (s *ScopedStore) SetChannelPts(ctx context.Context, userID int64, channelID int64, pts int) (err error)
- func (s *ScopedStore) SetDate(ctx context.Context, userID int64, date int) (err error)
- func (s *ScopedStore) SetDateSeq(ctx context.Context, userID int64, date int, seq int) (err error)
- func (s *ScopedStore) SetPhoneNumber(ctx context.Context, userID int64, phoneNumber string) (err error)
- func (s *ScopedStore) SetPts(ctx context.Context, userID int64, pts int) (err error)
- func (s *ScopedStore) SetQts(ctx context.Context, userID int64, qts int) (err error)
- func (s *ScopedStore) SetSeq(ctx context.Context, userID int64, seq int) (err error)
- func (s *ScopedStore) SetState(ctx context.Context, userID int64, state updates.State) (err error)
- func (s *ScopedStore) SetUserAccessHash(ctx context.Context, forUserID int64, userID int64, accessHash int64) errordeprecated
- func (s *ScopedStore) SetUsername(ctx context.Context, entityType ids.PeerType, entityID int64, username string) (err error)
- type TelegramFile
- type TelegramFileLocationID
- type TelegramFileQuery
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoAccessHash = errors.New("access hash not found")
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct { *dbutil.Database TelegramFile *TelegramFileQuery }
func (*Container) GetScopedStore ¶
func (c *Container) GetScopedStore(telegramUserID int64) *ScopedStore
type ScopedStore ¶
type ScopedStore struct {
// contains filtered or unexported fields
}
ScopedStore is a wrapper around a database that implements [session.Storage] scoped to a specific Telegram user ID.
func (*ScopedStore) DeleteAccessHashesForUser ¶
func (s *ScopedStore) DeleteAccessHashesForUser(ctx context.Context) (err error)
func (*ScopedStore) DeleteChannelStateForUser ¶
func (s *ScopedStore) DeleteChannelStateForUser(ctx context.Context) (err error)
func (*ScopedStore) DeleteUserState ¶
func (s *ScopedStore) DeleteUserState(ctx context.Context) (err error)
func (*ScopedStore) ForEachChannels ¶
func (*ScopedStore) GetAccessHash ¶
func (*ScopedStore) GetChannelAccessHash
deprecated
func (*ScopedStore) GetChannelPts ¶
func (*ScopedStore) GetEntityIDByUsername ¶
func (*ScopedStore) GetUserAccessHash
deprecated
func (*ScopedStore) GetUserIDByPhoneNumber ¶
func (*ScopedStore) GetUsername ¶
func (*ScopedStore) SetAccessHash ¶
func (*ScopedStore) SetChannelAccessHash
deprecated
func (s *ScopedStore) SetChannelAccessHash(ctx context.Context, forUserID, channelID, accessHash int64) (err error)
Deprecated: only for interface, don't use directly. Use [SetAccessHash] instead.
func (*ScopedStore) SetChannelPts ¶
func (*ScopedStore) SetDateSeq ¶
func (*ScopedStore) SetPhoneNumber ¶
func (*ScopedStore) SetUserAccessHash
deprecated
func (*ScopedStore) SetUsername ¶
type TelegramFile ¶
type TelegramFile struct { LocationID TelegramFileLocationID MXC id.ContentURIString MIMEType string Size int // contains filtered or unexported fields }
func (*TelegramFile) Scan ¶
func (f *TelegramFile) Scan(row dbutil.Scannable) (*TelegramFile, error)
type TelegramFileLocationID ¶
type TelegramFileLocationID string
type TelegramFileQuery ¶
type TelegramFileQuery struct { *dbutil.QueryHelper[*TelegramFile] }
func (*TelegramFileQuery) GetByLocationID ¶
func (fq *TelegramFileQuery) GetByLocationID(ctx context.Context, locationID TelegramFileLocationID) (*TelegramFile, error)
func (*TelegramFileQuery) GetByMXC ¶
func (fq *TelegramFileQuery) GetByMXC(ctx context.Context, mxc string) (*TelegramFile, error)
Click to show internal directories.
Click to hide internal directories.