Documentation
¶
Overview ¶
Package memory provides a deterministic, concurrency-safe in-memory filesystem adapter intended for tests and ephemeral workloads.
Index ¶
- type Adapter
- func (a *Adapter) Capabilities() filesystem.CapabilitySet
- func (a *Adapter) Checksum(ctx context.Context, path filesystem.Path, ...) (filesystem.Checksum, error)
- func (a *Adapter) Copy(ctx context.Context, source, destination filesystem.Path, ...) error
- func (a *Adapter) Delete(ctx context.Context, path filesystem.Path) error
- func (a *Adapter) List(ctx context.Context, directory filesystem.Path, options filesystem.ListOptions) (filesystem.EntryIterator, error)
- func (a *Adapter) Move(ctx context.Context, source, destination filesystem.Path, ...) error
- func (a *Adapter) Open(ctx context.Context, path filesystem.Path) (io.ReadCloser, error)
- func (a *Adapter) OpenRange(ctx context.Context, path filesystem.Path, byteRange filesystem.ByteRange) (io.ReadCloser, error)
- func (a *Adapter) OpenWriter(ctx context.Context, path filesystem.Path, options filesystem.WriteOptions) (io.WriteCloser, error)
- func (a *Adapter) SetMetadata(ctx context.Context, path filesystem.Path, metadata map[string]string) error
- func (a *Adapter) SetVisibility(ctx context.Context, path filesystem.Path, visibility filesystem.Visibility) error
- func (a *Adapter) Stat(ctx context.Context, path filesystem.Path) (filesystem.Metadata, error)
- func (a *Adapter) Visibility(ctx context.Context, path filesystem.Path) (filesystem.Visibility, error)
- func (a *Adapter) Write(ctx context.Context, path filesystem.Path, source io.Reader, ...) (filesystem.Metadata, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter stores objects in memory and is safe for concurrent use.
func (*Adapter) Capabilities ¶
func (a *Adapter) Capabilities() filesystem.CapabilitySet
Capabilities reports the adapter's explicitly supported operations.
func (*Adapter) Checksum ¶
func (a *Adapter) Checksum(ctx context.Context, path filesystem.Path, algorithm filesystem.ChecksumAlgorithm) (filesystem.Checksum, error)
Checksum computes an explicitly requested digest.
func (*Adapter) Copy ¶
func (a *Adapter) Copy(ctx context.Context, source, destination filesystem.Path, options filesystem.CopyOptions) error
Copy duplicates an object and its properties.
func (*Adapter) List ¶
func (a *Adapter) List(ctx context.Context, directory filesystem.Path, options filesystem.ListOptions) (filesystem.EntryIterator, error)
List returns a deterministic snapshot iterator.
func (*Adapter) Move ¶
func (a *Adapter) Move(ctx context.Context, source, destination filesystem.Path, options filesystem.MoveOptions) error
Move atomically renames an object within this adapter.
func (*Adapter) Open ¶
func (a *Adapter) Open(ctx context.Context, path filesystem.Path) (io.ReadCloser, error)
Open returns an independent reader over an immutable snapshot.
func (*Adapter) OpenRange ¶
func (a *Adapter) OpenRange(ctx context.Context, path filesystem.Path, byteRange filesystem.ByteRange) (io.ReadCloser, error)
OpenRange returns an independent reader over a bounded object snapshot.
func (*Adapter) OpenWriter ¶
func (a *Adapter) OpenWriter(ctx context.Context, path filesystem.Path, options filesystem.WriteOptions) (io.WriteCloser, error)
OpenWriter returns a streaming writer that publishes through Write on Close. Abandoning it without closing leaves the publication incomplete.
func (*Adapter) SetMetadata ¶
func (a *Adapter) SetMetadata(ctx context.Context, path filesystem.Path, metadata map[string]string) error
SetMetadata replaces user metadata.
func (*Adapter) SetVisibility ¶
func (a *Adapter) SetVisibility(ctx context.Context, path filesystem.Path, visibility filesystem.Visibility) error
SetVisibility changes an object's coarse visibility.
func (*Adapter) Stat ¶
func (a *Adapter) Stat(ctx context.Context, path filesystem.Path) (filesystem.Metadata, error)
Stat returns a defensive metadata copy.
func (*Adapter) Visibility ¶
func (a *Adapter) Visibility(ctx context.Context, path filesystem.Path) (filesystem.Visibility, error)
Visibility retrieves an object's coarse visibility.
func (*Adapter) Write ¶
func (a *Adapter) Write(ctx context.Context, path filesystem.Path, source io.Reader, options filesystem.WriteOptions) (filesystem.Metadata, error)
Write consumes source before atomically publishing the object.