timer

package
v3.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(db database.Connector, cronService *cron.Cron) (*Service, error)

func (Service) AddCooldown

func (s Service) AddCooldown(tt plugins.TimerType, limiter, ruleID string, expiry time.Time) error

func (Service) AddPermit

func (s Service) AddPermit(channel, username string) error

func (*Service) CopyDatabase added in v3.20.0

func (s *Service) CopyDatabase(src, target *gorm.DB) error

func (Service) HasPermit

func (s Service) HasPermit(channel, username string) (bool, error)

func (Service) HasTimer

func (s Service) HasTimer(id string) (bool, error)

func (Service) InCooldown

func (s Service) InCooldown(tt plugins.TimerType, limiter, ruleID string) (bool, error)

func (Service) SetTimer

func (s Service) SetTimer(id string, expiry time.Time) error

func (*Service) UpdatePermitTimeout

func (s *Service) UpdatePermitTimeout(d time.Duration)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL