{"modulePath":"github.com/GoCodeAlone/workflow","version":"v0.87.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package artifact\n\n## Types\n\n```go\ntype Artifact struct {\n\tKey       string    `json:\"key\"`\n\tSize      int64     `json:\"size\"`\n\tCreatedAt time.Time `json:\"created_at\"`\n\tChecksum  string    `json:\"checksum\"` // SHA256 hex digest\n}\n```\nArtifact represents metadata about a stored artifact.\n\n```go\ntype LocalStore struct {\n\t// contains filtered or unexported fields\n}\n```\nLocalStore implements Store using the local filesystem. Artifacts are stored under {baseDir}/artifacts/{executionID}/{key}. Metadata (size, checksum, timestamp) is tracked in memory.\n\n```go\nfunc NewLocalStore(baseDir string) *LocalStore\n```\nNewLocalStore creates a new LocalStore rooted at baseDir.\n\n```go\nfunc (s *LocalStore) Delete(_ context.Context, executionID, key string) error\n```\nDelete removes an artifact from the local filesystem and metadata.\n\n```go\nfunc (s *LocalStore) Get(_ context.Context, executionID, key string) (io.ReadCloser, error)\n```\nGet retrieves an artifact from the local filesystem.\n\n```go\nfunc (s *LocalStore) List(_ context.Context, executionID string) ([]Artifact, error)\n```\nList returns all artifacts for a given execution ID, sorted by key.\n\n```go\nfunc (s *LocalStore) Put(_ context.Context, executionID, key string, reader io.Reader) error\n```\nPut stores an artifact on the local filesystem, computing SHA256 as it writes.\n\n```go\ntype Store interface {\n\t// Put stores an artifact for the given execution.\n\t// The reader's content is consumed and stored under the given key.\n\t// SHA256 checksum is computed during storage.\n\tPut(ctx context.Context, executionID, key string, reader io.Reader) error\n\n\t// Get retrieves an artifact by execution ID and key.\n\t// The caller is responsible for closing the returned ReadCloser.\n\tGet(ctx context.Context, executionID, key string) (io.ReadCloser, error)\n\n\t// List returns all artifacts for a given execution ID.\n\tList(ctx context.Context, executionID string) ([]Artifact, error)\n\n\t// Delete removes an artifact by execution ID and key.\n\tDelete(ctx context.Context, executionID, key string) error\n}\n```\nStore defines the interface for artifact storage backends. Artifacts are scoped by execution ID and identified by key.\n\n","path":"github.com/GoCodeAlone/workflow/artifact","name":"artifact","synopsis":"","isRedistributable":true}
