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

fs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package fs is the local-disk blob store. Blobs live at <root>/sha256/<ab>/<cd>/<hex>; the two shard levels keep directories small enough for tools and filesystems that slow down on huge listings. Upload sessions live at <root>/_uploads/<id>/ on the same filesystem, so committing is an fsync and a rename rather than a copy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is a blob.Store on a local directory.

func New

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

New opens (creating if needed) a store rooted at dir.

func (*Store) BeginUpload

func (s *Store) BeginUpload(ctx context.Context, opts ...blob.UploadOption) (blob.Upload, error)

BeginUpload starts a session.

func (*Store) Delete

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

Delete removes the blob.

func (*Store) Exists

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

Exists reports whether the blob is stored.

func (*Store) Open

func (s *Store) Open(ctx context.Context, sha string) (io.ReadSeekCloser, blob.Info, error)

Open returns the blob for random access.

func (*Store) ResumeUpload

func (s *Store) ResumeUpload(ctx context.Context, id string) (blob.Upload, error)

ResumeUpload reopens a session.

func (*Store) Stat

func (s *Store) Stat(ctx context.Context, sha string) (blob.Info, error)

Stat returns a blob's size and digest.

func (*Store) Walk

func (s *Store) Walk(ctx context.Context, fn func(blob.Info) error) error

Walk visits every stored blob.

Jump to

Keyboard shortcuts

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