store

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataStore

type DataStore interface {
	Load() (*PersistedData, error)
	Save(data *PersistedData) error
}

type JsonDataStore

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

func NewJSONDataStore

func NewJSONDataStore(path string) (*JsonDataStore, error)

func (*JsonDataStore) Load

func (j *JsonDataStore) Load() (*PersistedData, error)

func (*JsonDataStore) Save

func (j *JsonDataStore) Save(data *PersistedData) error

type PersistedData

type PersistedData struct {
	Jobs []PersistedJob
}

type PersistedJob

type PersistedJob struct {
	ID       uuid.UUID
	Pipeline string

	Completed bool `json:",omitempty"`
	Canceled  bool `json:",omitempty"`
	// Created is the schedule / queue time of the job
	Created time.Time
	// Start is the actual start time of the job
	Start *time.Time `json:",omitempty"`
	// End is the actual end time of the job (can be nil if incomplete)
	End *time.Time `json:",omitempty"`

	Variables map[string]interface{} `json:",omitempty"`
	User      string                 `json:",omitempty"`

	Tasks []PersistedTask
}

type PersistedTask

type PersistedTask struct {
	Name         string
	Script       []string
	DependsOn    []string   `json:",omitempty"`
	AllowFailure bool       `json:",omitempty"`
	Status       string     `json:",omitempty"`
	Start        *time.Time `json:",omitempty"`
	End          *time.Time `json:",omitempty"`
	Skipped      bool       `json:",omitempty"`
	ExitCode     int16      `json:",omitempty"`
	Errored      bool       `json:",omitempty"`
	Error        *string    `json:",omitempty"`
}

Jump to

Keyboard shortcuts

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