timer

package
v0.0.0-...-9604f65 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

Variables

This section is empty.

Functions

func NewSubSystemRunner

func NewSubSystemRunner(j Job, c controller.Controller) (cron.Job, error)

Types

type Controller

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

func New

func (*Controller) Create

func (c *Controller) Create(job Job) error

func (*Controller) CreateJob

func (c *Controller) CreateJob(w http.ResponseWriter, r *http.Request)

func (*Controller) Delete

func (c *Controller) Delete(id string) error

func (*Controller) DeleteJob

func (c *Controller) DeleteJob(w http.ResponseWriter, r *http.Request)

func (*Controller) Get

func (c *Controller) Get(id string) (Job, error)

func (*Controller) GetEntity

func (c *Controller) GetEntity(id string) (controller.Entity, error)

func (*Controller) GetJob

func (c *Controller) GetJob(w http.ResponseWriter, r *http.Request)

func (*Controller) InUse

func (c *Controller) InUse(depType, id string) ([]string, error)

func (*Controller) List

func (c *Controller) List() ([]Job, error)

func (*Controller) ListJobs

func (c *Controller) ListJobs(w http.ResponseWriter, r *http.Request)

func (*Controller) LoadAPI

func (c *Controller) LoadAPI(r *mux.Router)

func (*Controller) On

func (c *Controller) On(id string, on bool) error

func (*Controller) Runner

func (c *Controller) Runner(j Job) (cron.Job, error)

func (*Controller) Setup

func (c *Controller) Setup() error

func (*Controller) Start

func (c *Controller) Start()

func (*Controller) Stop

func (c *Controller) Stop()

func (*Controller) Update

func (c *Controller) Update(id string, payload Job) error

func (*Controller) UpdateJob

func (c *Controller) UpdateJob(w http.ResponseWriter, r *http.Request)

type Job

type Job struct {
	ID     string          `json:"id"`
	Name   string          `json:"name"`
	Enable bool            `json:"enable"`
	Type   string          `json:"type"`
	Month  string          `json:"month"`
	Week   string          `json:"week"`
	Day    string          `json:"day"`
	Hour   string          `json:"hour"`
	Minute string          `json:"minute"`
	Second string          `json:"second"`
	Target json.RawMessage `json:"target"`
}

func (*Job) CronSpec

func (j *Job) CronSpec() string

func (*Job) Validate

func (j *Job) Validate() error

type Reminder

type Reminder struct {
	Title   string `json:"title"`
	Message string `json:"message"`
}

type ReminderRunner

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

func (ReminderRunner) Run

func (r ReminderRunner) Run()

type SubSystemRunner

type SubSystemRunner struct {
	Type string
	// contains filtered or unexported fields
}

func (*SubSystemRunner) Run

func (m *SubSystemRunner) Run()

type Trigger

type Trigger struct {
	ID       string        `json:"id"`
	Revert   bool          `json:"revert"`
	On       bool          `json:"on"`
	Duration time.Duration `json:"duration"`
}

Jump to

Keyboard shortcuts

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