schedule

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeMinutes = "minutes"
	TypeHours   = "hours"
	TypeDays    = "days"
	TypeWeeks   = "weeks"
	TypeMonths  = "months"
	TypeCron    = "cron"

	WeekDayMonday    = "monday"
	WeekDayTuesday   = "tuesday"
	WeekDayWednesday = "wednesday"
	WeekDayThursday  = "thursday"
	WeekDayFriday    = "friday"
	WeekDaySaturday  = "saturday"
	WeekDaySunday    = "sunday"
)

Variables

This section is empty.

Functions

func WeekdayToString

func WeekdayToString(weekday time.Weekday) string

Types

type Configuration

type Configuration struct {
	Type            string   `json:"type"`
	MinutesInterval *int     `json:"minutesInterval"` // 1-59 minutes between triggers
	HoursInterval   *int     `json:"hoursInterval"`   // 1-23 hours between triggers
	DaysInterval    *int     `json:"daysInterval"`    // 1-31 days between triggers
	WeeksInterval   *int     `json:"weeksInterval"`   // 1-52 weeks between triggers
	MonthsInterval  *int     `json:"monthsInterval"`  // 1-24 months between triggers
	Minute          *int     `json:"minute"`          // 0-59 for hours, days, weeks, months
	Hour            *int     `json:"hour"`            // 0-23 for days, weeks, months
	WeekDays        []string `json:"weekDays"`        // For weeks scheduling (multiple days)
	DayOfMonth      *int     `json:"dayOfMonth"`      // 1-31 for months scheduling
	CronExpression  *string  `json:"cronExpression"`  // For cron scheduling
	Timezone        *string  `json:"timezone"`        // Timezone offset (e.g., "0", "-5", "5.5")
}

type Metadata

type Metadata struct {
	NextTrigger   *string `json:"nextTrigger"`
	ReferenceTime *string `json:"referenceTime"` // For minutes scheduling: time when schedule was first set up
}

type Schedule

type Schedule struct{}

func (*Schedule) Actions

func (s *Schedule) Actions() []core.Action

func (*Schedule) Color

func (s *Schedule) Color() string

func (*Schedule) Configuration

func (s *Schedule) Configuration() []configuration.Field

func (*Schedule) Description

func (s *Schedule) Description() string

func (*Schedule) HandleAction

func (s *Schedule) HandleAction(ctx core.TriggerActionContext) (map[string]any, error)

func (*Schedule) HandleWebhook

func (s *Schedule) HandleWebhook(ctx core.WebhookRequestContext) (int, error)

func (*Schedule) Icon

func (s *Schedule) Icon() string

func (*Schedule) Label

func (s *Schedule) Label() string

func (*Schedule) Name

func (s *Schedule) Name() string

func (*Schedule) Setup

func (s *Schedule) Setup(ctx core.TriggerContext) error

Jump to

Keyboard shortcuts

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