Versions in this module Expand all Collapse all v0 v0.2.3 Jan 14, 2023 v0.2.2 Feb 23, 2022 Changes in this version + func CopyStore(from, to *Limit) + type Limit struct + Activities map[string]map[string]*models.Activity + ActivityBySession map[string]*models.Activity + FlushInterval *time.Duration + LastBookingEnds *int64 + LastFlush *int64 + Locked *bool + Max *int + Message *string + Now func() int64 + ProvisionalPeriod *time.Duration + Sessions map[string]map[string]int64 + UserBySession map[string]string + func ImportAll(l *Limit, b []byte) (*Limit, error) + func New(ctx context.Context) *Limit + func (l *Limit) ExportAll() ([]byte, error) + func (l *Limit) FlushAll() + func (l *Limit) GetActivityFromSessionID(sid string) (*models.Activity, error) + func (l *Limit) GetAllActivities() map[string]*models.Activity + func (l *Limit) GetAllActivitiesCount() int + func (l *Limit) GetAllSessionCount() int + func (l *Limit) GetLastBookingEnds() int64 + func (l *Limit) GetLockBookings() bool + func (l *Limit) GetMax() int + func (l *Limit) GetMessage() string + func (l *Limit) GetUserActivities(user string) (map[string]*models.Activity, error) + func (l *Limit) GetUserSessionCount(user string) int + func (l *Limit) LockBookings() + func (l *Limit) PostImportEssential(ctx context.Context) + func (l *Limit) ProvisionalRequest(userID string, exp int64) (func(), func(activity *models.Activity), string, error) + func (l *Limit) Request(who string, exp int64) (string, error) + func (l *Limit) Reset() + func (l *Limit) SetMessage(msg string) + func (l *Limit) SetNow(now func() int64) + func (l *Limit) UnlockBookings() + func (l *Limit) WithFlush(interval time.Duration) *Limit + func (l *Limit) WithMax(max int) *Limit + func (l *Limit) WithNow(now func() int64) *Limit + func (l *Limit) WithProvisionalPeriod(interval time.Duration) *Limit