schedule

package
v0.0.0-...-f49e489 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetTimeZone

func SetTimeZone(tz string) error

SetTimeZone will configure the timezone in which schedules strings are defined.

Types

type Schedule

type Schedule struct {
	Description string `json:"Description"`
	// contains filtered or unexported fields
}

Schedule is the object that describes the schedule. It contains one read-only attribute "Description". To actually use it, use one of the public methods on this object.

func New

func New(text string) (*Schedule, error)

New will return a Schedule object for given schedule description.

func (*Schedule) Copy

func (s *Schedule) Copy() *Schedule

Copy will return a fresh copy of the Schedule object.

func (*Schedule) GetNextTrigger

func (s *Schedule) GetNextTrigger(now time.Time) (time.Time, error)

GetNextTrigger will return the time the next trigger that occurs after given time (now) should occur according to this schedule.

func (*Schedule) GetReplicas

func (s *Schedule) GetReplicas() (int, error)

GetReplicas will return the number of replicas that should be applied according to the schedule.

func (*Schedule) GetState

func (s *Schedule) GetState() (State, error)

GetState will return the state that should be applied according to the schedule.

func (*Schedule) GetTriggers

func (s *Schedule) GetTriggers() []string

GetTriggers will return the reference codes of the triggers that should be triggered.

func (*Schedule) HasReplicas

func (s *Schedule) HasReplicas() bool

HasReplicas checks if the given schedule has a replicas settings that should be applied.

type State

type State string

State describes the possible values of the 'state' attribute.

var (
	// RestoreState is used by GetState to specify the state "restore"
	RestoreState State = "restore"
	// SaveState is used by GetState to specify the state "save"
	SaveState State = "save"
	// NoState is used by GetState to indicate no state was configured
	NoState State
)

Jump to

Keyboard shortcuts

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