scheduledevents2

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2018 License: MIT Imports: 17 Imported by: 0

README

The sucessor of the original scheduled events system for yagpdb that was running on redis, this one however is running on postgres.

The old system did not support things like clustering and was overall a bit messy and unstructured.

Documentation

Index

Constants

View Source
const DBSchema = `` /* 406-byte string literal not displayed */

Variables

This section is empty.

Functions

func CheckDiscordErrRetry added in v1.11.0

func CheckDiscordErrRetry(err error) bool

func InitSchema added in v1.11.0

func InitSchema() error

func RegisterHandler

func RegisterHandler(eventName string, dataFormat interface{}, handler HandlerFunc)

RegisterHandler registers a handler for the scpecified event name dataFormat is optional and should not be a pointer, it should match the type you're passing into ScheduleEvent

func RegisterLegacyMigrater added in v1.11.0

func RegisterLegacyMigrater(eventName string, migrationHandler func(t time.Time, data string) error)

RegisterHandler registers a handler for the scpecified event name dataFormat is optional and should not be a pointer, it should match the type you're passing into ScheduleEvent

func RegisterPlugin

func RegisterPlugin()

func ScheduleEvent added in v1.11.0

func ScheduleEvent(evtName string, guildID int64, runAt time.Time, data interface{}) error

Types

type HandlerFunc

type HandlerFunc func(evt *models.ScheduledEvent, data interface{}) (retry bool, err error)

type RegisteredHandler

type RegisteredHandler struct {
	EvtName    string
	DataFormat interface{}
	Handler    HandlerFunc
}

type ScheduledEvents

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

func (*ScheduledEvents) BotInit added in v1.11.0

func (se *ScheduledEvents) BotInit()

func (*ScheduledEvents) MigrateLegacyEvents added in v1.11.0

func (se *ScheduledEvents) MigrateLegacyEvents()

func (*ScheduledEvents) Name

func (se *ScheduledEvents) Name() string

func (*ScheduledEvents) RunBackgroundWorker added in v1.11.0

func (p *ScheduledEvents) RunBackgroundWorker()

func (*ScheduledEvents) StopBackgroundWorker added in v1.11.0

func (p *ScheduledEvents) StopBackgroundWorker(wg *sync.WaitGroup)

func (*ScheduledEvents) StopBot added in v1.11.0

func (se *ScheduledEvents) StopBot(wg *sync.WaitGroup)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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