Documentation ¶
Index ¶
- Variables
- func DeferSendMessage(when time.Time, data SendLaterMeta) (uint64, error)
- func MsgDelete(at time.Time, meta MetaMsgDelete) (uint64, error)
- func RegisterHandler(name string, h insched.Handler)
- type Database
- func (db *Database) Add(e insched.Entry) (insched.Entry, error)
- func (db *Database) Defer(id uint64, by time.Duration) (err error)
- func (db *Database) Get(id uint64) (e insched.Entry, err error)
- func (db *Database) GetPending(action string, t time.Time) (el []insched.Entry, err error)
- func (db *Database) Remove(id uint64) (err error)
- func (db *Database) Reschedule(id uint64, to time.Time) (err error)
- type MetaMsgDelete
- type SendLaterMeta
Constants ¶
This section is empty.
Variables ¶
View Source
var Config = &localConfig{}
Config is the config that contains global config stuff, i mean it is named config so what else would it be
View Source
var Module = &module.Module{ Name: "nschedule", DgoHandlers: []interface{}{ onReady, }, DebugCommands: []*drc.Command{ cSendlater, cDeletelater, }, Config: Config, InitFunc: func(mod *module.Module) error { Scheduler.Log = new(logger) insched.Debug = Config.Debug return nil }, OpenFunc: func(m *module.Module) error { db.ss = enpsql.GetSession() return nil }, CloseFunc: func(_ *module.Module) { Scheduler.Stop() }, }
Module contains the module, i mean what else would it contain
View Source
var Scheduler = insched.New(db)
Functions ¶
func DeferSendMessage ¶
func DeferSendMessage(when time.Time, data SendLaterMeta) (uint64, error)
DeferSendMessage schedules a message to be sent at a later time currently only debug, don't use
func RegisterHandler ¶
RegisterHandler adds a handler to the global scheduler
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (*Database) GetPending ¶
type MetaMsgDelete ¶
type SendLaterMeta ¶
Click to show internal directories.
Click to hide internal directories.