Documentation ¶
Index ¶
- Constants
- Variables
- func ResumeAllReaders(ctx context.Context, log *slog.Logger, chatStor Storage, tgBot *telebot.Bot, ...) (count uint32, err error)
- func StopChatReader(subId string) (found bool)
- func StopChatReaders(chatId int64)
- func UserLeftHandlerFunc(chatStor Storage) telebot.HandlerFunc
- type Chat
- type Reader
- type Storage
Constants ¶
View Source
const ReaderTtl = 24 * time.Hour
Variables ¶
View Source
var ErrAlreadyExists = errors.New("chat already exists")
View Source
var ErrInternal = errors.New("internal failure")
View Source
var ErrNotFound = errors.New("chat or subscription not found")
Functions ¶
func ResumeAllReaders ¶
func StopChatReader ¶
func StopChatReaders ¶
func StopChatReaders(chatId int64)
func UserLeftHandlerFunc ¶
func UserLeftHandlerFunc(chatStor Storage) telebot.HandlerFunc
Types ¶
type Storage ¶
type Storage interface { io.Closer LinkSubscription(ctx context.Context, c Chat) (err error) GetSubscriptionLink(ctx context.Context, subId string) (c Chat, err error) UnlinkSubscription(ctx context.Context, subId string) (err error) Delete(ctx context.Context, id int64) (count int64, err error) GetBatch(ctx context.Context, idRem, idDiv uint32, limit uint32, cursor int64) (page []Chat, err error) Count(ctx context.Context) (count int64, err error) }
func NewStorage ¶
Click to show internal directories.
Click to hide internal directories.