cron

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdAdd

func CmdAdd(ctx context.Context, client *clientv3.Client, name, scheduleExpr, runTTL string, cmdArgs []string) (int, error)

func CmdLs

func CmdLs(ctx context.Context, client *clientv3.Client, showLast, useJSON bool) (int, error)

func CmdRm

func CmdRm(ctx context.Context, client *clientv3.Client, name string) (int, error)

Types

type Conchd

type Conchd struct {
	StatusAddr string
	// contains filtered or unexported fields
}

func NewConchd

func NewConchd(endpoints []string, dialTimeout, ttl time.Duration, logger *slog.Logger) (*Conchd, error)

func (*Conchd) Run

func (cd *Conchd) Run(ctx context.Context) error

type CronHolder

type CronHolder struct {
	// contains filtered or unexported fields
}

func (*CronHolder) Acquire

func (ch *CronHolder) Acquire(ctx context.Context) (int64, error)

func (*CronHolder) Key

func (ch *CronHolder) Key() string

func (*CronHolder) Name

func (ch *CronHolder) Name() string

func (*CronHolder) Release

func (ch *CronHolder) Release(ctx context.Context) error

type CronStatusItem

type CronStatusItem struct {
	Name     string `json:"name"`
	Schedule string `json:"schedule"`
	NextTick string `json:"next_tick"`
	LastTick string `json:"last_tick"`
	Node     string `json:"node"`
	Exit     *int   `json:"exit"`
	Duration string `json:"duration"`
}

func GetCronStatus

func GetCronStatus(ctx context.Context, client *clientv3.Client) ([]CronStatusItem, error)

type ElectStatusItem

type ElectStatusItem struct {
	Office         string `json:"office"`
	Leader         string `json:"leader"`
	Pid            int    `json:"pid"`
	Started        string `json:"started"`
	Cmd            string `json:"cmd"`
	CreateRevision int64  `json:"create_revision"`
}

func GetElectStatus

func GetElectStatus(ctx context.Context, client *clientv3.Client) ([]ElectStatusItem, error)

type JobSpec

type JobSpec struct {
	Schedule string   `json:"schedule"`
	Cmd      []string `json:"cmd"`
	RunTTL   string   `json:"run_ttl"`
	AddedBy  string   `json:"added_by"`
	AddedAt  string   `json:"added_at"`
}

type ResultJSON

type ResultJSON struct {
	Node     string `json:"node"`
	Exit     int    `json:"exit"`
	Started  string `json:"started"`
	Duration string `json:"duration"`
}

type SemaHolderStatus

type SemaHolderStatus struct {
	Host           string `json:"host"`
	Pid            int    `json:"pid"`
	Started        string `json:"started"`
	Cmd            string `json:"cmd"`
	CreateRevision int64  `json:"create_revision"`
}

type SemaStatusItem

type SemaStatusItem struct {
	Name     string             `json:"name"`
	Max      int                `json:"max"`
	Holders  []SemaHolderStatus `json:"holders"`
	Waitlist []SemaHolderStatus `json:"waitlist"`
}

func GetSemaStatus

func GetSemaStatus(ctx context.Context, client *clientv3.Client) ([]SemaStatusItem, error)

Jump to

Keyboard shortcuts

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