Documentation
¶
Index ¶
- Constants
- type Repo
- func (r *Repo) AnyInProgress() bool
- func (r *Repo) AppendRecurrings(recurrings []*models.Recurring) error
- func (r *Repo) AppendSchedules(schedules []*models.Schedule) ([]string, error)
- func (r Repo) CreateSchedulesFromRecurring(adminRoomID id.RoomID) error
- func (r *Repo) DisableRecurring(host string) error
- func (r *Repo) GetAllHosts() ([]string, error)
- func (r *Repo) GetAllRecurrings() ([]*models.Recurring, error)
- func (r *Repo) GetAllSchedules() ([]*models.Schedule, error)
- func (r *Repo) GetContacts(host string) (*models.Contacts, error)
- func (r *Repo) GetRandomRecurringTime() string
- func (r *Repo) GetRecurrings(host string) ([]*models.Recurring, error)
- func (r *Repo) GetRuns(host string) ([]*models.Run, error)
- func (r *Repo) GetSchedules(host string) ([]*models.Schedule, error)
- func (r *Repo) GetStats() (*models.Stats, error)
- func (r *Repo) IsAutoLocked(host string) bool
- func (r *Repo) IsLocked(host string) bool
- func (r *Repo) IsReminded(host string) bool
- func (r *Repo) Lock(host string) error
- func (r *Repo) PopInvites(max int) ([]*models.Invite, error)
- func (r *Repo) PopNotifications(max int) ([]*models.Notification, error)
- func (r *Repo) PopSchedules(max int) ([]*models.Schedule, error)
- func (r *Repo) PurgeHost(host string) error
- func (r *Repo) ReleaseAutoLock(host string)
- func (r *Repo) RemoveRuns(max []byte) error
- func (r *Repo) RemoveSchedules(host string, fromRecurring bool) error
- func (r *Repo) SetContacts(host string, contacts *models.Contacts) error
- func (r *Repo) SetReminded(host string) error
- func (r *Repo) Stop()
- func (r *Repo) Unlock(host string)
- func (r *Repo) UpdateAutoLocks(hosts []string)
- func (r *Repo) UpsertInvite(inv *models.Invite) error
- func (r *Repo) UpsertNotification(n *models.Notification, differentID ...string) error
- func (r *Repo) UpsertRecurring(s *models.Recurring) error
- func (r *Repo) UpsertRun(run *models.Run) error
- func (r *Repo) UpsertSchedule(s *models.Schedule) error
Constants ¶
const ( // AutoLockDuration is the duration of the automatic lock of the auto executions, // it can be multiplied by the attempt number AutoLockDuration = 60 * time.Minute // LockDuration is the duration of the lock of the scheduler's runs LockDuration = 30 * time.Minute )
const ReminderDelay = 7 * 24 * time.Hour
ReminderDelay is the delay between sending reminders to the same host
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
Repo is a wrapper around bbolt.DB
func (*Repo) AnyInProgress ¶
AnyInProgress checks if there are any locks
func (*Repo) AppendRecurrings ¶
AppendRecurrings inserts new recurring schedules, only if not exists already
func (*Repo) AppendSchedules ¶
AppendSchedules to the database, only if homeserver doesn't have any
func (Repo) CreateSchedulesFromRecurring ¶
CreateSchedulesFromRecurring creates schedules from recurring schedules.
func (*Repo) DisableRecurring ¶
DisableRecurring removes recurrings and schedules
func (*Repo) GetAllHosts ¶
GetHosts returns ALL hosts from the database
func (*Repo) GetAllRecurrings ¶
GetAllRecurrings from the database
func (*Repo) GetAllSchedules ¶
GetAllSchedules from the database
func (*Repo) GetContacts ¶
GetContacts returns the contacts for the given host.
func (*Repo) GetRandomRecurringTime ¶
GetRandomRecurringTime generates random valid TimeFormatRecurring string
func (*Repo) GetRecurrings ¶
GetRecurrings from the database
func (*Repo) GetSchedules ¶
GetSchedules from the database
func (*Repo) IsAutoLocked ¶
IsAutoLocked checks if the host is locked for the automatic execution
func (*Repo) IsReminded ¶
IsReminded checks if the host has been reminded in the last ReminderDelay
func (*Repo) PopInvites ¶
PopInvites from the database
func (*Repo) PopNotifications ¶
func (r *Repo) PopNotifications(max int) ([]*models.Notification, error)
PopNotifications from the database
func (*Repo) PopSchedules ¶
PopSchedules pops up to max schedules that are ready for execution.
func (*Repo) ReleaseAutoLock ¶
ReleaseAutoLock releases the lock of the host for the automatic execution
func (*Repo) RemoveRuns ¶
RemoveRuns removes runs from the database
func (*Repo) RemoveSchedules ¶
RemoveSchedules removes all schedules for a given homeserver.
func (*Repo) SetContacts ¶
SetContacts sets the contacts for the given host.
func (*Repo) SetReminded ¶
SetReminded sets the reminder for the host
func (*Repo) UpdateAutoLocks ¶
UpdateAutoLocks updates the locks of the hosts for the automatic execution
func (*Repo) UpsertInvite ¶
UpsertInvite adds or updates the invite in the database.
func (*Repo) UpsertNotification ¶
func (r *Repo) UpsertNotification(n *models.Notification, differentID ...string) error
UpsertNotification inserts or updates a notification in the database.
func (*Repo) UpsertRecurring ¶
UpsertRecurring inserts or updates recurring schedule