schedule

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidRecurringType = errors.New("invalid recurring type")
	ErrStartDateTimeInPast  = errors.New("start_datetime must be greater than or equal to current time")
)

Functions

This section is empty.

Types

type Recurring

type Recurring uint

Type can be daily, weekly or monthly.

const (
	None Recurring = iota
	Hourly
	Daily
	Weekly
	Monthly
)

func (Recurring) MarshalJSON

func (rt Recurring) MarshalJSON() ([]byte, error)

func (Recurring) String

func (rt Recurring) String() string

func (*Recurring) UnmarshalJSON

func (rt *Recurring) UnmarshalJSON(data []byte) error

type Schedule

type Schedule struct {
	StartDateTime   time.Time `json:"start_datetime,omitempty"`   // When the schedule becomes active
	Time            time.Time `json:"time,omitempty"`             // Specific time for the rule to run
	Recurring       Recurring `json:"recurring,omitempty"`        // None, Daily, Weekly, Monthly
	RecurringPeriod uint      `json:"recurring_period,omitempty"` // Controls how many intervals to skip between executions: 1 = every interval, 2 = every second interval, etc.
}

func (Schedule) MarshalJSON

func (s Schedule) MarshalJSON() ([]byte, error)

func (Schedule) NextDue

func (s Schedule) NextDue() time.Time

func (*Schedule) UnmarshalJSON

func (s *Schedule) UnmarshalJSON(data []byte) error

func (Schedule) Validate

func (s Schedule) Validate() error

Jump to

Keyboard shortcuts

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