leader

package
v0.0.0-...-f6bd42f Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Triggers []GitTrigger `json:"triggers"`
	Run      string       `json:"run"`
}

type Config

type Config struct {
	PubKeyFile string `json:"pubkey_file"`

	StateDir   string `json:"state_dir"`
	CacheDir   string `json:"cache_dir"`
	ActionsDir string `json:"actions_dir"`

	GitCacheFor       common.Duration `json:"cache_git_for"`
	ParallelDownloads int             `json:"parallel_downloads"`
}

func LoadConfig

func LoadConfig(filename string) (Config, error)

func (Config) Actions

func (cfg Config) Actions() ([]Action, error)

func (Config) DB

func (cfg Config) DB() (*DB, error)

func (Config) GitCache

func (cfg Config) GitCache() *gitcache.Cache

type DB

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

func (*DB) Close

func (s *DB) Close() error

func (*DB) GCRunningJobs

func (s *DB) GCRunningJobs() error

func (*DB) GetJob

func (s *DB) GetJob(id common.JobID) (common.Job, error)

func (*DB) GetTrigger

func (s *DB) GetTrigger(expr string) (string, error)

func (*DB) ListJobs

func (s *DB) ListJobs(status common.JobStatus) (_ []common.Job, err error)

func (*DB) NewJob

func (s *DB) NewJob(triggerExprs []string, triggerVals []string, cmd string) (common.JobID, error)

func (*DB) SetTrigger

func (s *DB) SetTrigger(expr string, val string) error

func (*DB) SwapJobStatus

func (s *DB) SwapJobStatus(id common.JobID, oldStatus, newStatus common.JobStatus, statusMsg string) (ok bool, _ error)

type GitTrigger

type GitTrigger struct {
	RepoURL string `json:"repo_url"`
	Rev     string `json:"rev"`
}

Jump to

Keyboard shortcuts

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