Versions in this module Expand all Collapse all v0 v0.1.0 Aug 29, 2026 Changes in this version + func DefaultNodeID() string + func NewRunID(jobName string, scheduledAt time.Time) string + type Config struct + Election ElectionConfig + Location string + Namespace string + NodeID string + RetryInterval time.Duration + ShutdownTimeout time.Duration + Standalone bool + WithSeconds bool + type Cron struct + func New(config Config, dependencies Dependencies) (*Cron, error) + func NewWithElector(config Config, elector Elector, logger *slog.Logger) (*Cron, error) + func (c *Cron) AddDistributedJob(job Job) error + func (c *Cron) AddLocalJob(job Job) error + func (c *Cron) AfterInit() + func (c *Cron) BeforeShutdown() + func (c *Cron) Epoch() int64 + func (c *Cron) Init() error + func (c *Cron) IsLeader() bool + func (c *Cron) Shutdown() error + type Dependencies struct + Etcd *clientv3.Client + Logger *slog.Logger + type ElectionConfig struct + CallbackTimeout time.Duration + Prefix string + ResignTimeout time.Duration + TTL int + type Elector interface + Run func(ctx context.Context, nodeID string, leader LeaderFunc) error + type Handler func(ctx context.Context, task Task) error + type Job struct + Handler Handler + Name string + Spec string + type JobType string + const JobTypeDistributed + const JobTypeLocal + type LeaderFunc = func(ctx context.Context, epoch int64) error + type Task struct + Epoch int64 + Name string + NodeID string + RunID string + ScheduledAt time.Time + Type JobType