cron

package
v0.0.0-...-2200cc9 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CronCollection

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

CronCollection holds a collection of cron schedulers.

func NewCronCollection

func NewCronCollection(ccc CronCollectionConfig) *CronCollection

NewCronCollection is the constructor for CronCollection

func (*CronCollection) AllStatuses

func (collection *CronCollection) AllStatuses() (map[string]CronStatus, error)

AllStatuses shows all cron configurations. This is not correct. The information should somehow be in the database.

func (*CronCollection) BecomesFollower

func (collection *CronCollection) BecomesFollower()

BecomesFollower keep track of leader/follower state

func (*CronCollection) BecomesLeader

func (collection *CronCollection) BecomesLeader()

BecomesLeader keep track of leader/follower state

func (*CronCollection) Delete

func (collection *CronCollection) Delete(config CronConfig)

Delete a cron scheduler configuration

func (*CronCollection) StartAll

func (collection *CronCollection) StartAll()

StartAll cron schedulers.

func (*CronCollection) StopAll

func (collection *CronCollection) StopAll()

StopAll cron schedulers.

func (*CronCollection) Update

func (collection *CronCollection) Update(config CronConfig)

Update receives config update from jetstream and configure the cron scheduler

type CronCollectionConfig

type CronCollectionConfig struct {
	// JetStreamContext
	JetStreamContext nats.JetStreamContext

	// ConfigKV
	ConfigKV *configkv.ConfigKV
}

CronCollectionConfig

type CronCollectionHTTPGet

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

func NewCronCollectionHTTPGet

func NewCronCollectionHTTPGet(collection *CronCollection) *CronCollectionHTTPGet

func (*CronCollectionHTTPGet) ServeHTTP

func (handler *CronCollectionHTTPGet) ServeHTTP(w http.ResponseWriter, r *http.Request)

type CronConfig

type CronConfig struct {
	ID          string
	Schedule    string
	Timezone    string
	WorkerQueue string
}

CronConfig is the setting for cronjob

type CronStatus

type CronStatus struct {
	ID          string
	Schedule    string
	Timezone    string
	WorkerQueue string
	IsRunning   bool
	LastRun     time.Time
	NextRun     time.Time
	RunCount    int
}

CronStatus is used to display the current status of cronjob

Jump to

Keyboard shortcuts

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