memstore

package
v0.4.1 Latest Latest
Warning

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

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

Documentation

Overview

Package memstore is a blob.Store that keeps everything in memory. It is for tests and for servers whose blobs need not outlive the process.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Store)

Option configures New.

func WithClock

func WithClock(now func() time.Time) Option

WithClock makes the Store read the time from now instead of time.Now. Tests use it to move CommittedAt and StartedAt.

type Store

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

Store is an in-memory blob.Store. The zero value is not usable; call New.

func New

func New(opts ...Option) *Store

New returns an empty Store.

func (*Store) Abort

func (s *Store) Abort(_ context.Context, ws string, digest blob.Digest) error

func (*Store) Begin

func (s *Store) Begin(_ context.Context, ws string, m blob.Manifest) error

func (*Store) Close

func (s *Store) Close() error

Close does nothing. The Store stays usable.

func (*Store) Complete

func (s *Store) Complete(_ context.Context, ws string, digest blob.Digest) error

func (*Store) Delete

func (s *Store) Delete(_ context.Context, ws string, digest blob.Digest) error

func (*Store) DeleteWorkspace

func (s *Store) DeleteWorkspace(_ context.Context, ws string) error

func (*Store) List

func (s *Store) List(_ context.Context, ws string) iter.Seq2[blob.Digest, error]

func (*Store) ListStaged

func (s *Store) ListStaged(_ context.Context, ws string) iter.Seq2[blob.Upload, error]

func (*Store) ListWorkspaces

func (s *Store) ListWorkspaces(context.Context) iter.Seq2[string, error]

func (*Store) Open

func (s *Store) Open(_ context.Context, ws string, digest blob.Digest) (io.ReadSeekCloser, error)

func (*Store) PutChunk

func (s *Store) PutChunk(_ context.Context, ws string, digest blob.Digest, index int, r io.Reader) error

func (*Store) SetUnreferencedSince

func (s *Store) SetUnreferencedSince(_ context.Context, ws string, digest blob.Digest, t time.Time) error

func (*Store) Staged

func (s *Store) Staged(_ context.Context, ws string, digest blob.Digest) (blob.Upload, []int, error)

func (*Store) Stat

func (s *Store) Stat(_ context.Context, ws string, digest blob.Digest) (blob.Info, error)

Jump to

Keyboard shortcuts

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