filestore

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package filestore is the local-filesystem artifact backend: the built-in default, zero infrastructure, directly inspectable.

Each ref maps to two sibling files under root: "<ref>" (data) and "<ref>.manifest.json" (manifest). Put writes both via temp-file+rename so a reader never observes a half-written pair.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileStore

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

FileStore implements artifact.Store over a directory tree.

func New

func New(dir string) (*FileStore, error)

New returns a FileStore rooted at dir, creating dir (with parents) if absent. A failure here is a startup error, not a per-request one.

func (*FileStore) Exists

func (fs *FileStore) Exists(ctx context.Context, ref string) (bool, error)

func (*FileStore) Get

func (fs *FileStore) Get(ctx context.Context, ref string) ([]byte, []byte, error)

func (*FileStore) Name

func (fs *FileStore) Name() string

func (*FileStore) Put

func (fs *FileStore) Put(ctx context.Context, ref string, data, manifest []byte) error

Put writes data + manifest atomically. Manifest is written first, then data, then nothing else can fail — so a present data file always has a present manifest beside it.

Jump to

Keyboard shortcuts

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