crontab

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteJob

func DeleteJob(name string) error

* * DeleteJob * @param name string * @return error *

func DeleteJobById

func DeleteJobById(id string) error

* * DeleteJobById * @param id string * @return error *

func HttpCrontabs added in v0.1.4

func HttpCrontabs(w http.ResponseWriter, r *http.Request)

* * HttpCrontabs * @param w http.ResponseWriter * @param r *http.Request *

func ListJobs

func ListJobs() (et.Items, error)

* * ListJobs * @return et.Items, error *

func Load

func Load()

* * Load *

func Save added in v0.1.4

func Save()

* * Save *

func Start

func Start() error

* * Start * @return error *

func StartJob

func StartJob(name string) (int, error)

* * StartJob * @param name string * @return int, error *

func StartJobById

func StartJobById(id string) (int, error)

* * StartJobById * @param id string * @return int, error *

func Stop

func Stop() error

* * Stop * @return error *

func StopJob

func StopJob(name string) error

* * StopJob * @param name string * @return error *

func StopJobById

func StopJobById(id string) error

* * StopJobById * @param id string * @return error *

Types

type Job

type Job struct {
	ID      string  `json:"id"`
	Name    string  `json:"name"`
	Channel string  `json:"channel"`
	Params  et.Json `json:"params"`
	Spec    string  `json:"spec"`
	Started bool    `json:"started"`
	Idx     int     `json:"idx"`
	// contains filtered or unexported fields
}

func AddFnJob added in v0.1.2

func AddFnJob(name, spec, channel string, params et.Json, fn func()) (*Job, error)

* * AddFnJob * @param name, spec, channel string, params et.Json * @return *Job, error *

func AddJob

func AddJob(name, spec, channel string, params et.Json) (*Job, error)

* * AddJob * @param name, spec, channel string, params et.Json * @return *Job, error *

func (*Job) Json added in v0.1.4

func (j *Job) Json() et.Json

type Jobs

type Jobs struct {
	Id      string `json:"id"`
	Started bool   `json:"started"`
	// contains filtered or unexported fields
}

func New

func New() *Jobs

func (*Jobs) AddJob

func (s *Jobs) AddJob(name, spec, channel string, params et.Json, fn func()) (*Job, error)

* * AddJob * @param name, spec, channel string, params et.Json * @return *Job, error *

func (*Jobs) DeleteJob

func (s *Jobs) DeleteJob(name string) error

* * DeleteJob * @param name string * @return error *

func (*Jobs) DeleteJobById

func (s *Jobs) DeleteJobById(id string) error

* * DeleteJobById * @param id string * @return error *

func (*Jobs) List

func (s *Jobs) List() et.Items

* * List * @return et.Items *

func (*Jobs) Load added in v0.1.4

func (s *Jobs) Load() error

* * Load * @return error *

func (*Jobs) Save added in v0.1.4

func (s *Jobs) Save() error

* * Save * @return error *

func (*Jobs) Start

func (s *Jobs) Start() error

* * Start * @return error *

func (*Jobs) StartJob

func (s *Jobs) StartJob(name string) (int, error)

* * StartJob * @param name string * @return int, error *

func (*Jobs) StartJobById

func (s *Jobs) StartJobById(id string) (int, error)

* * StartJobById * @param id string * @return int, error *

func (*Jobs) Stop

func (s *Jobs) Stop() error

* * Stop * @return error *

func (*Jobs) StopJob

func (s *Jobs) StopJob(name string) error

* * StopJob * @param name string *

func (*Jobs) StopJobById

func (s *Jobs) StopJobById(id string) error

* * StopJobById * @param id string * @return error *

type Storage added in v0.1.4

type Storage struct {
	Jobs    []*Job
	Version string
}

func NewStorage added in v0.1.4

func NewStorage() *Storage

Jump to

Keyboard shortcuts

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