storage

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package storage provides file-based JSON storage for GitHub Actions data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store manages file-based storage for workflow runs and jobs.

func NewStore

func NewStore(baseDir string) (*Store, error)

NewStore creates a new Store with the given base directory. Returns an error if the directory doesn't exist or isn't a directory.

func (*Store) IterJobs

func (s *Store) IterJobs(workflowID int64) iter.Seq2[json.RawMessage, error]

IterJobs iterates over all stored job files for a workflow.

func (*Store) IterRuns

func (s *Store) IterRuns(workflowID int64) iter.Seq2[json.RawMessage, error]

IterRuns iterates over all stored runs for a workflow.

func (*Store) JobExists

func (s *Store) JobExists(workflowID, runID int64) bool

JobExists checks if a job file exists for the given run.

func (*Store) JobPath

func (s *Store) JobPath(workflowID, runID int64) string

JobPath returns the file path for jobs of a workflow run.

func (*Store) JobsDir

func (s *Store) JobsDir(workflowID int64) string

JobsDir returns the directory path for jobs of a workflow.

func (*Store) ListStoredRunIDs

func (s *Store) ListStoredRunIDs(workflowID int64) ([]int64, error)

ListStoredRunIDs returns all run IDs stored for a workflow.

func (*Store) ListStoredRunIDsWithoutJobs

func (s *Store) ListStoredRunIDsWithoutJobs(workflowID int64) ([]int64, error)

ListStoredRunIDsWithoutJobs returns run IDs that don't have corresponding job files.

func (*Store) LoadJobs

func (s *Store) LoadJobs(workflowID, runID int64) (json.RawMessage, error)

LoadJobs loads jobs for a single run from storage.

func (*Store) LoadRun

func (s *Store) LoadRun(workflowID, runID int64) (json.RawMessage, error)

LoadRun loads a single run from storage.

func (*Store) RunExists

func (s *Store) RunExists(workflowID, runID int64) bool

RunExists checks if a run file exists.

func (*Store) RunPath

func (s *Store) RunPath(workflowID, runID int64) string

RunPath returns the file path for a workflow run.

func (*Store) RunsDir

func (s *Store) RunsDir(workflowID int64) string

RunsDir returns the directory path for runs of a workflow.

func (*Store) SaveJobs

func (s *Store) SaveJobs(workflowID, runID int64, data json.RawMessage) error

SaveJobs saves workflow jobs as JSON.

func (*Store) SaveRun

func (s *Store) SaveRun(workflowID, runID int64, data json.RawMessage) error

SaveRun saves a workflow run as JSON.

Jump to

Keyboard shortcuts

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