Add artifact workdir layout and locking

This commit is contained in:
2026-05-02 10:56:42 -05:00
parent 6caecb1baa
commit fb659e0d3d
8 changed files with 615 additions and 46 deletions

View File

@@ -1,32 +1,57 @@
package artifacts
import (
"context"
"fmt"
"os"
)
// S3Store is a placeholder S3-compatible artifact store.
// S3Store is a placeholder for future remote artifact persistence support.
type S3Store struct {
Bucket string
Prefix string
}
// WriteLocal returns a not-yet-implemented error in the scaffold.
func (s *S3Store) WriteLocal(_ context.Context, _ Ref, _ []byte) error {
return fmt.Errorf("artifacts s3 write local: not yet implemented")
// SessionPaths is not implemented for S3-backed storage.
func (s *S3Store) SessionPaths(_ string) SessionPaths {
return SessionPaths{}
}
// ReadLocal returns a not-yet-implemented error in the scaffold.
func (s *S3Store) ReadLocal(_ context.Context, _ Ref) ([]byte, error) {
return nil, fmt.Errorf("artifacts s3 read local: not yet implemented")
// EnsureLayout returns a not-yet-implemented error in the scaffold.
func (s *S3Store) EnsureLayout(_ string) (SessionPaths, error) {
return SessionPaths{}, fmt.Errorf("artifacts s3 ensure layout: not yet implemented")
}
// ExistsLocal returns a not-yet-implemented error in the scaffold.
func (s *S3Store) ExistsLocal(_ context.Context, _ Ref) (bool, error) {
return false, fmt.Errorf("artifacts s3 exists local: not yet implemented")
// CopyInput returns a not-yet-implemented error in the scaffold.
func (s *S3Store) CopyInput(_, _, _ string) (Ref, error) {
return Ref{}, fmt.Errorf("artifacts s3 copy input: not yet implemented")
}
// Upload returns a not-yet-implemented error in the scaffold.
func (s *S3Store) Upload(_ context.Context, _ Ref) (string, error) {
return "", fmt.Errorf("artifacts s3 upload: not yet implemented")
// Exists returns a not-yet-implemented error in the scaffold.
func (s *S3Store) Exists(_ string) (bool, error) {
return false, fmt.Errorf("artifacts s3 exists: not yet implemented")
}
// ExistsRef returns a not-yet-implemented error in the scaffold.
func (s *S3Store) ExistsRef(_ Ref) (bool, error) {
return false, fmt.Errorf("artifacts s3 exists ref: not yet implemented")
}
// WriteFileAtomic returns a not-yet-implemented error in the scaffold.
func (s *S3Store) WriteFileAtomic(_ string, _ []byte, _ os.FileMode) error {
return fmt.Errorf("artifacts s3 write file atomic: not yet implemented")
}
// Checksum returns a not-yet-implemented error in the scaffold.
func (s *S3Store) Checksum(_ string) (string, error) {
return "", fmt.Errorf("artifacts s3 checksum: not yet implemented")
}
// AcquireSessionLock returns a not-yet-implemented error in the scaffold.
func (s *S3Store) AcquireSessionLock(_ string) (*LockHandle, error) {
return nil, fmt.Errorf("artifacts s3 acquire lock: not yet implemented")
}
// ReleaseSessionLock returns a not-yet-implemented error in the scaffold.
func (s *S3Store) ReleaseSessionLock(_ *LockHandle) error {
return fmt.Errorf("artifacts s3 release lock: not yet implemented")
}