schedule

package
v3.0.0-beta10 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitData

func InitData()

InitData reset package objects data, it can be used for tests.

Types

type Config

type Config struct {
	Action             string `json:"action"`
	Schedule           string `json:"schedule"`
	Key                string `json:"key"`
	LastRunFile        string `json:"last_run_file"`
	LastSuccessFile    string `json:"last_success_file"`
	MaxParallel        int    `json:"max_parallel"`
	Require            string `json:"require"`
	RequireCollector   bool   `json:"require_collector"`
	RequireProvisioned bool   `json:"require_provisioned"`
}

type Data

type Data[T Dataer] struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Data defines a shared holder for all objects Dataer

var (

	// TableData is the package data holder for all objects schedule
	TableData *Data[Table]
)

func NewData

func NewData[T Dataer]() *Data[T]

func (*Data[T]) GetAll

func (c *Data[T]) GetAll() []DataElement[T]

func (*Data[T]) GetByPath

func (c *Data[T]) GetByPath(p naming.Path) *T

func (*Data[T]) GetPaths

func (c *Data[T]) GetPaths() naming.Paths

func (*Data[T]) Set

func (c *Data[T]) Set(p naming.Path, v *T)

func (*Data[T]) Unset

func (c *Data[T]) Unset(p naming.Path)

type DataElement

type DataElement[T Dataer] struct {
	Path  naming.Path
	Value *T
}

type Dataer

type Dataer interface {
	Table
}

type Entry

type Entry struct {
	Config
	LastRunAt time.Time   `json:"last_run_at"`
	NextRunAt time.Time   `json:"next_run_at"`
	Node      string      `json:"node"`
	Path      naming.Path `json:"path"`
	RunDir    string      `json:"run_dir"`
}

func (Entry) GetLastRun

func (t Entry) GetLastRun() time.Time

func (Entry) GetNext

func (t Entry) GetNext() (time.Time, time.Duration, error)

func (Entry) RID

func (t Entry) RID() string

func (Entry) SetLastRun

func (t Entry) SetLastRun(tm time.Time) error

func (Entry) SetLastSuccess

func (t Entry) SetLastSuccess(tm time.Time) error

type Table

type Table []Entry

func NewTable

func NewTable(entries ...Entry) Table

func (Table) Add

func (t Table) Add(i interface{}) Table

func (Table) AddEntries

func (t Table) AddEntries(l ...Entry) Table

func (Table) AddTable

func (t Table) AddTable(l Table) Table

func (Table) DeepCopy

func (t Table) DeepCopy() *Table

func (Table) DelEntry

func (t Table) DelEntry(e Entry) Table

func (Table) Merge

func (t Table) Merge(i interface{}) Table

func (Table) MergeEntries

func (t Table) MergeEntries(l ...Entry) Table

func (Table) MergeEntry

func (t Table) MergeEntry(e Entry) Table

Jump to

Keyboard shortcuts

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