schedule

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KnownCalendars

func KnownCalendars() []string

func KnownSessions

func KnownSessions() []string

Types

type Calendar

type Calendar struct {
	Name     string
	Timezone string
	// contains filtered or unexported fields
}

func LookupCalendar

func LookupCalendar(name string) (*Calendar, error)

func (*Calendar) SessionAt

func (c *Calendar) SessionAt(t time.Time) SessionState

func (*Calendar) SupportsSession

func (c *Calendar) SupportsSession(session Session) bool

type InvocationState

type InvocationState struct {
	Paused              bool       `json:"paused,omitempty"`
	PausedUntil         *time.Time `json:"paused_until,omitempty"`
	PauseReason         string     `json:"pause_reason,omitempty"`
	SkipNext            bool       `json:"skip_next,omitempty"`
	Degraded            bool       `json:"degraded,omitempty"`
	ConsecutiveFailures int        `json:"consecutive_failures,omitempty"`
	LastEvaluatedAt     *time.Time `json:"last_evaluated_at,omitempty"`
	LastAttemptedAt     *time.Time `json:"last_attempted_at,omitempty"`
	LastFiredAt         *time.Time `json:"last_fired_at,omitempty"`
	LastSkippedAt       *time.Time `json:"last_skipped_at,omitempty"`
	NextFireAt          *time.Time `json:"next_fire_at,omitempty"`
	LastStatus          string     `json:"last_status,omitempty"`
	LastDetail          string     `json:"last_detail,omitempty"`
}

func (InvocationState) Clone

func (s InvocationState) Clone() InvocationState

type Manifest

type Manifest struct {
	Version     int                  `json:"version"`
	Pod         string               `json:"pod"`
	Invocations []ManifestInvocation `json:"invocations,omitempty"`
}

type ManifestInvocation

type ManifestInvocation struct {
	ID       string `json:"id"`
	Service  string `json:"service"`
	AgentID  string `json:"agent_id"`
	Schedule string `json:"schedule"`
	Timezone string `json:"timezone"`
	Message  string `json:"message"`
	Name     string `json:"name,omitempty"`
	To       string `json:"to,omitempty"`
	When     *When  `json:"when,omitempty"`
	Wake     Wake   `json:"wake"`
}

type Session

type Session string
const (
	SessionClosed     Session = "closed"
	SessionAnyOpen    Session = "any-open"
	SessionRegular    Session = "regular"
	SessionPreMarket  Session = "pre-market"
	SessionAfterHours Session = "after-hours"
)

func ParseSession

func ParseSession(raw string) (Session, error)

type SessionState

type SessionState struct {
	Open     bool    `json:"open"`
	Name     Session `json:"name"`
	Timezone string  `json:"timezone,omitempty"`
	Reason   string  `json:"reason,omitempty"`
}

func (SessionState) Matches

func (s SessionState) Matches(required Session) bool

type StateFile

type StateFile struct {
	Version     int                        `json:"version"`
	Pod         string                     `json:"pod,omitempty"`
	UpdatedAt   *time.Time                 `json:"updated_at,omitempty"`
	Invocations map[string]InvocationState `json:"invocations,omitempty"`
}

func (StateFile) Clone

func (s StateFile) Clone() StateFile

type Wake

type Wake struct {
	Adapter string   `json:"adapter"`
	Target  string   `json:"target"`
	Command []string `json:"command"`
}

type When

type When struct {
	Calendar string  `json:"calendar,omitempty" yaml:"calendar,omitempty"`
	Session  Session `json:"session,omitempty" yaml:"session,omitempty"`
}

func (*When) Clone

func (w *When) Clone() *When

func (*When) SessionOrDefault

func (w *When) SessionOrDefault() Session

func (*When) Validate

func (w *When) Validate() error

Jump to

Keyboard shortcuts

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