Help us shape the future of Go! Take the 2026 Go Developer Survey

local

package
v1.233.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStore

func NewStore(opts artifact.StoreOptions) (artifact.Backend, error)

NewStore creates a new local filesystem artifact backend.

Types

type Metadata

type Metadata = artifact.Metadata

Metadata is an alias for artifact.Metadata used in the local backend.

type Store

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

Store implements the artifact.Backend interface using the local filesystem. It stores each artifact as a single file with a metadata JSON sidecar.

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, name string) error

Delete deletes an artifact from the local filesystem. Removes both the artifact file and its metadata sidecar. Idempotent — returns nil if the artifact does not exist.

func (*Store) Download

func (s *Store) Download(ctx context.Context, name string) (io.ReadCloser, *artifact.Metadata, error)

Download downloads a single data stream from the local filesystem. Returns an io.ReadCloser for the file and the metadata sidecar. Callers must close the returned reader when done.

func (*Store) Exists

func (s *Store) Exists(ctx context.Context, name string) (bool, error)

Exists checks if an artifact exists as a file (not directory).

func (*Store) GetMetadata

func (s *Store) GetMetadata(ctx context.Context, name string) (*artifact.Metadata, error)

GetMetadata retrieves metadata for an artifact without downloading the content.

func (*Store) List

func (s *Store) List(ctx context.Context, query artifact.Query) ([]artifact.ArtifactInfo, error)

List lists artifacts matching the given query. Walks basePath looking for metadata sidecar files with a corresponding artifact file (not dir), applies Query filters, and sorts newest first.

func (*Store) Name

func (s *Store) Name() string

Name returns the store type name.

func (*Store) Upload

func (s *Store) Upload(ctx context.Context, name string, data io.Reader, size int64, metadata *Metadata) error

Upload uploads a single data stream to the local filesystem. Writes the data as a single file and the metadata as a JSON sidecar.

Jump to

Keyboard shortcuts

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