scheduler

package
v0.0.0-...-0dfd57a Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Service scheduler provides reminders and scheduled task messages.

Index

Constants

This section is empty.

Variables

View Source
var Module = &services.Module{
	Name:        "scheduler",
	Version:     "1.0",
	NewInstance: NewService,
}

Functions

This section is empty.

Types

type Dependencies

type Dependencies struct {
	Client sarif.Client
}

type ScheduleMessage

type ScheduleMessage struct {
	RandomBefore string `json:"random_before,omitempty"`
	RandomAfter  string `json:"random_after,omitempty"`
	Time         string `json:"time,omitempty"`
	Duration     string `json:"duration,omitempty"`
	Task
}

type Scheduler

type Scheduler struct {
	sarif.Client
	Store *store.Store
	// contains filtered or unexported fields
}

func NewService

func NewService(deps *Dependencies) *Scheduler

func (*Scheduler) Enable

func (s *Scheduler) Enable() error

type Task

type Task struct {
	Id        int64         `json:"-"`
	Time      time.Time     `json:"time,omitempty"`
	Location  string        `json:"location,omitempty"`
	Reply     sarif.Message `json:"reply,omitempty"`
	Finished  bool          `json:"finished"`
	CreatedAt time.Time     `json:"-"`
	UpdatedAt time.Time     `json:"-"`
}

func (Task) Key

func (t Task) Key() string

func (Task) String

func (t Task) String() string

Jump to

Keyboard shortcuts

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