Documentation
¶
Overview ¶
Package filestore is the local-filesystem continuation backend: the open-core 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 ¶
- type FileStore
- func (fs *FileStore) Create(ctx context.Context, key string, r io.Reader, meta continuation.Meta) (continuation.Ref, error)
- func (fs *FileStore) Delete(ctx context.Context, key string) error
- func (fs *FileStore) Exists(ctx context.Context, key string) (bool, error)
- func (fs *FileStore) Get(ctx context.Context, key string) ([]byte, continuation.Meta, error)
- func (fs *FileStore) List(ctx context.Context, prefix string) ([]string, error)
- func (fs *FileStore) Name() string
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 ¶
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).