Documentation
¶
Overview ¶
Package local is a storage.Store on the local filesystem, for development, tests and single-host deployments with a persistent volume. It is not shared between machines; use an object store such as storage/s3 for more than one instance or an ephemeral disk.
Everything lives under one root directory, reached only through os.Root so no key or symlink can leave it. An object is a directory holding its bytes (data) and its description (meta), published by renaming a complete temporary directory into place: the bytes and the metadata appear together or not at all, and a crash leaves only a temporary directory that no read ever sees and the next New sweeps.
Index ¶
- type Store
- func (s *Store) Close() error
- func (s *Store) Delete(ctx context.Context, key string) error
- func (s *Store) Open(ctx context.Context, key string, offset, length int64) (io.ReadCloser, error)
- func (s *Store) Put(ctx context.Context, r io.Reader, opts storage.PutOptions) (storage.Object, error)
- func (s *Store) Stat(ctx context.Context, key string) (storage.Info, error)
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 filesystem storage.Store. Close it when done.
func New ¶
New opens, creating it if needed, the Store rooted at dir. Directories are created 0700 and files 0600. It removes temporary directories left by an interrupted write.
func (*Store) Delete ¶
Delete implements storage.Store. The object leaves by one rename, so it is never half there, and its bytes are removed afterwards.