Documentation ¶
Index ¶
- Variables
- type Storage
- func (s *Storage) DelayReminder(ctx context.Context, id int64, remindAt time.Time) error
- func (s *Storage) GetBotState(ctx context.Context, userID int64) (domain.BotState, error)
- func (s *Storage) GetMyReminders(ctx context.Context, userID, chatID int64) ([]domain.Reminder, error)
- func (s *Storage) GetPendingReminders(ctx context.Context, limit int64) ([]domain.Reminder, error)
- func (s *Storage) RemoveReminder(ctx context.Context, id int64) error
- func (s *Storage) SaveBotState(ctx context.Context, state domain.BotState) error
- func (s *Storage) SaveReminder(ctx context.Context, reminder domain.Reminder) (int64, error)
- func (s *Storage) SaveUser(ctx context.Context, user domain.User) error
- func (s *Storage) SetReminderStatus(ctx context.Context, id int64, status domain.ReminderStatus) error
- func (s *Storage) SetUserStatus(ctx context.Context, id int64, status domain.UserStatus) error
- func (s *Storage) UpdateReminder(ctx context.Context, reminder domain.Reminder) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrBotStateNotFound - bot state is not found. ErrBotStateNotFound = errors.New("bot state is not found") // ErrBotStateAlreadyExists - bot state is already exists. ErrBotStateAlreadyExists = errors.New("bot state already exists") )
View Source
var ( // ErrUserAlreadyExists - user is already exist. ErrUserAlreadyExists = errors.New("user already exists") // ErrUserNotFound - user is not found. ErrUserNotFound = errors.New("user is not found") )
View Source
var ErrReminderNotFound = errors.New("reminder is not found")
ErrReminderNotFound - reminder is not found
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage - storage.
func NewSqllite ¶
NewSqllite creates a new sqlite Storage.
func (*Storage) DelayReminder ¶
DelayReminder - delays reminder by id. Reminder will be fired at remindAt time.
func (*Storage) GetBotState ¶
GetBotState - returns bot state by user id.
func (*Storage) GetMyReminders ¶
func (s *Storage) GetMyReminders(ctx context.Context, userID, chatID int64) ([]domain.Reminder, error)
GetMyReminders - returns reminders by user id and chat id.
func (*Storage) GetPendingReminders ¶
GetPendingReminders - returns reminders in domain.ReminderStatusPending status for active users.
func (*Storage) RemoveReminder ¶
RemoveReminder - removes reminder by id.
func (*Storage) SaveBotState ¶
SaveBotState - saves bot state.
func (*Storage) SaveReminder ¶
SaveReminder - saves reminder.
func (*Storage) SetReminderStatus ¶
func (s *Storage) SetReminderStatus(ctx context.Context, id int64, status domain.ReminderStatus) error
SetReminderStatus - set's reminder status by id.
func (*Storage) SetUserStatus ¶
SetUserStatus - set's user status by user id.
Click to show internal directories.
Click to hide internal directories.