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

filestore

package
v0.2.49 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MPL-2.0 Imports: 8 Imported by: 0

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