persistence

package
v1.12.11 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRequestIdNotFound = fmt.Errorf("request id not found")
	ErrNoStatusDataToday = fmt.Errorf("no status data today")
	ErrNoStatusData      = fmt.Errorf("no status data")
)

Functions

This section is empty.

Types

type DAGStatus

type DAGStatus struct {
	File      string
	Dir       string
	DAG       *dag.DAG
	Status    *model.Status
	Suspended bool
	Error     error
	ErrorT    *string
}

func NewDAGStatus

func NewDAGStatus(d *dag.DAG, s *model.Status, suspended bool, err error) *DAGStatus

type DAGStore

type DAGStore interface {
	Create(name string, spec []byte) (string, error)
	Delete(name string) error
	List() (ret []*dag.DAG, errs []string, err error)
	GetMetadata(name string) (*dag.DAG, error)
	GetDetails(name string) (*dag.DAG, error)
	Grep(pattern string) (ret []*GrepResult, errs []string, err error)
	Load(name string) (*dag.DAG, error)
	Rename(oldName, newName string) error
	GetSpec(name string) (string, error)
	UpdateSpec(name string, spec []byte) error
}

type DataStoreFactory

type DataStoreFactory interface {
	NewHistoryStore() HistoryStore
	NewDAGStore() DAGStore
	NewFlagStore() FlagStore
}

type FlagStore

type FlagStore interface {
	ToggleSuspend(id string, suspend bool) error
	IsSuspended(id string) bool
}

type GrepResult

type GrepResult struct {
	Name    string
	DAG     *dag.DAG
	Matches []*grep.Match
}

type HistoryStore

type HistoryStore interface {
	Open(dagFile string, t time.Time, requestId string) error
	Write(st *model.Status) error
	Close() error
	Update(dagFile, requestId string, st *model.Status) error
	ReadStatusRecent(dagFile string, n int) []*model.StatusFile
	ReadStatusToday(dagFile string) (*model.Status, error)
	FindByRequestId(dagFile string, requestId string) (*model.StatusFile, error)
	RemoveAll(dagFile string) error
	RemoveOld(dagFile string, retentionDays int) error
	Rename(oldName, newName string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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