Documentation
¶
Index ¶
- type Artifact
- type LocalStore
- func (s *LocalStore) Delete(_ context.Context, executionID, key string) error
- func (s *LocalStore) Get(_ context.Context, executionID, key string) (io.ReadCloser, error)
- func (s *LocalStore) List(_ context.Context, executionID string) ([]Artifact, error)
- func (s *LocalStore) Put(_ context.Context, executionID, key string, reader io.Reader) error
- type S3Store
- func (s *S3Store) Delete(ctx context.Context, executionID, key string) error
- func (s *S3Store) Get(ctx context.Context, executionID, key string) (io.ReadCloser, error)
- func (s *S3Store) List(ctx context.Context, executionID string) ([]Artifact, error)
- func (s *S3Store) Put(ctx context.Context, executionID, key string, reader io.Reader) error
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Artifact ¶
type Artifact struct {
Key string `json:"key"`
Size int64 `json:"size"`
CreatedAt time.Time `json:"created_at"`
Checksum string `json:"checksum"` // SHA256 hex digest
}
Artifact represents metadata about a stored artifact.
type LocalStore ¶
type LocalStore struct {
// contains filtered or unexported fields
}
LocalStore implements Store using the local filesystem. Artifacts are stored under {baseDir}/artifacts/{executionID}/{key}. Metadata (size, checksum, timestamp) is tracked in memory.
func NewLocalStore ¶
func NewLocalStore(baseDir string) *LocalStore
NewLocalStore creates a new LocalStore rooted at baseDir.
func (*LocalStore) Delete ¶
func (s *LocalStore) Delete(_ context.Context, executionID, key string) error
Delete removes an artifact from the local filesystem and metadata.
func (*LocalStore) Get ¶
func (s *LocalStore) Get(_ context.Context, executionID, key string) (io.ReadCloser, error)
Get retrieves an artifact from the local filesystem.
type S3Store ¶
type S3Store struct {
// contains filtered or unexported fields
}
S3Store implements Store using an S3-compatible backend. Objects are stored under {prefix}/artifacts/{executionID}/{key}.
func NewS3Store ¶
NewS3Store creates a new S3Store.
func (*S3Store) List ¶
List returns all artifacts for a given execution ID by listing S3 objects under the execution prefix.
type Store ¶
type Store interface {
// Put stores an artifact for the given execution.
// The reader's content is consumed and stored under the given key.
// SHA256 checksum is computed during storage.
Put(ctx context.Context, executionID, key string, reader io.Reader) error
// Get retrieves an artifact by execution ID and key.
// The caller is responsible for closing the returned ReadCloser.
Get(ctx context.Context, executionID, key string) (io.ReadCloser, error)
// List returns all artifacts for a given execution ID.
List(ctx context.Context, executionID string) ([]Artifact, error)
// Delete removes an artifact by execution ID and key.
Delete(ctx context.Context, executionID, key string) error
}
Store defines the interface for artifact storage backends. Artifacts are scoped by execution ID and identified by key.