storage

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRunNotFound    = errors.New("run not found")
	ErrOutputNotFound = errors.New("output not found")
	ErrInvalidRunID   = errors.New("invalid run ID")
)

Functions

func DefaultPath

func DefaultPath() string

Types

type Config

type Config struct {
	LocalPath  string
	S3Bucket   string
	S3Region   string
	S3Prefix   string
	AWSProfile string
}

type HybridStore

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

func NewHybridStore

func NewHybridStore(local *LocalStore, s3 *S3Store) *HybridStore

func (*HybridStore) Close

func (h *HybridStore) Close() error

func (*HybridStore) DeleteRun

func (h *HybridStore) DeleteRun(id string) error

func (*HybridStore) DownloadRun

func (h *HybridStore) DownloadRun(id string) error

func (*HybridStore) GetOutput

func (h *HybridStore) GetOutput(runID string) ([]byte, error)

func (*HybridStore) GetRun

func (h *HybridStore) GetRun(id string) (*run.Run, error)

func (*HybridStore) IsLocal

func (h *HybridStore) IsLocal(id string) bool

func (*HybridStore) ListRuns

func (h *HybridStore) ListRuns(opts ListOptions) ([]*run.Run, error)

func (*HybridStore) ListRunsLocal

func (h *HybridStore) ListRunsLocal(opts ListOptions) ([]*run.Run, error)

func (*HybridStore) ListS3RunIDs

func (h *HybridStore) ListS3RunIDs() (map[string]bool, error)

func (*HybridStore) ListS3Runs

func (h *HybridStore) ListS3Runs(opts ListOptions) ([]*run.Run, error)

func (*HybridStore) OutputPath

func (h *HybridStore) OutputPath(runID string) string

func (*HybridStore) SaveOutput

func (h *HybridStore) SaveOutput(runID string, output []byte) error

func (*HybridStore) SaveRun

func (h *HybridStore) SaveRun(r *run.Run) error

func (*HybridStore) Sync

func (h *HybridStore) Sync() (*SyncResult, error)

func (*HybridStore) UploadRun

func (h *HybridStore) UploadRun(id string) error

type ListOptions

type ListOptions struct {
	Workspace  string
	Since      time.Time
	Status     run.Status
	User       string
	Program    string
	Action     string
	Branch     string
	HasChanges bool
	Limit      int
}

type LocalStore

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

func New

func New(localPath string) (*LocalStore, error)

func NewLocalStore

func NewLocalStore(baseDir string) (*LocalStore, error)

func (*LocalStore) Close

func (s *LocalStore) Close() error

func (*LocalStore) DeleteRun

func (s *LocalStore) DeleteRun(id string) error

func (*LocalStore) GetOutput

func (s *LocalStore) GetOutput(runID string) ([]byte, error)

func (*LocalStore) GetRun

func (s *LocalStore) GetRun(id string) (*run.Run, error)

func (*LocalStore) HasRun

func (s *LocalStore) HasRun(id string) bool

func (*LocalStore) ListRuns

func (s *LocalStore) ListRuns(opts ListOptions) ([]*run.Run, error)

func (*LocalStore) ListRunsLocal

func (s *LocalStore) ListRunsLocal(opts ListOptions) ([]*run.Run, error)

func (*LocalStore) OutputPath

func (s *LocalStore) OutputPath(runID string) string

func (*LocalStore) SaveOutput

func (s *LocalStore) SaveOutput(runID string, output []byte) error

func (*LocalStore) SaveRun

func (s *LocalStore) SaveRun(r *run.Run) error

func (*LocalStore) Sync

func (s *LocalStore) Sync() (*SyncResult, error)

type S3Store

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

func NewS3Store

func NewS3Store(bucket, region, prefix string) (*S3Store, error)

func NewS3StoreWithProfile

func NewS3StoreWithProfile(bucket, region, prefix, profile string) (*S3Store, error)

func (*S3Store) Close

func (s *S3Store) Close() error

func (*S3Store) DeleteRun

func (s *S3Store) DeleteRun(id string) error

func (*S3Store) GetOutput

func (s *S3Store) GetOutput(runID string) ([]byte, error)

func (*S3Store) GetRun

func (s *S3Store) GetRun(id string) (*run.Run, error)

func (*S3Store) ListRunIDs

func (s *S3Store) ListRunIDs() (map[string]bool, error)

func (*S3Store) ListRuns

func (s *S3Store) ListRuns(opts ListOptions) ([]*run.Run, error)

func (*S3Store) OutputPath

func (s *S3Store) OutputPath(runID string) string

func (*S3Store) SaveOutput

func (s *S3Store) SaveOutput(runID string, output []byte) error

func (*S3Store) SaveRun

func (s *S3Store) SaveRun(r *run.Run) error

type Store

type Store interface {
	SaveRun(r *run.Run) error
	GetRun(id string) (*run.Run, error)
	ListRuns(opts ListOptions) ([]*run.Run, error)
	ListRunsLocal(opts ListOptions) ([]*run.Run, error)
	SaveOutput(runID string, output []byte) error
	GetOutput(runID string) ([]byte, error)
	OutputPath(runID string) string
	DeleteRun(id string) error
	Sync() (*SyncResult, error)
	Close() error
}

func NewFromConfig

func NewFromConfig(cfg Config) (Store, error)

func NewFromEnv

func NewFromEnv() (Store, error)

type SyncResult

type SyncResult struct {
	Uploaded   int `json:"uploaded"`
	Downloaded int `json:"downloaded"`
	Errors     int `json:"errors"`
}

Jump to

Keyboard shortcuts

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