filestore

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MPL-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package filestore is the local-filesystem continuation backend: the bundled default, zero infrastructure, directly inspectable.

Create-if-absent is atomic: content is written to a temp file in the destination directory, then os.Link'd into place. os.Link fails with EEXIST if the destination already exists, which IS the create-if-absent primitive — and because the linked inode already holds the complete bytes, a reader never observes a partial object.

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 continuation.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) Create

func (fs *FileStore) Create(ctx context.Context, key string, r io.Reader, meta continuation.Meta) (continuation.Ref, error)

Create writes data at key iff key is absent (atomic; ErrExists if present).

func (*FileStore) Delete

func (fs *FileStore) Delete(ctx context.Context, key string) error

func (*FileStore) Exists

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

func (*FileStore) Get

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

func (*FileStore) List

func (fs *FileStore) List(ctx context.Context, prefix string) ([]string, error)

List returns logical keys (relative to root, "/"-separated, sanitized form) for every regular file under prefix.

func (*FileStore) Name

func (fs *FileStore) Name() string

Jump to

Keyboard shortcuts

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