memory

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MaxObjects int
	MaxBytes   int
}

Config configures an in-memory object store.

type Store

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

Store is an in-process object.Store for tests and examples.

func NewResource

func NewResource(id resource.ResourceID, display string) (*object.Resource, *Store, error)

NewResource builds an object.Resource over a memory store.

func NewStore

func NewStore(cfg Config) *Store

NewStore creates a bounded memory object store.

func (*Store) Close

func (s *Store) Close() error

Close marks the store closed.

func (*Store) Delete

func (s *Store) Delete(_ context.Context, bucket, key string) error

Delete implements object.Store.

func (*Store) Get

func (s *Store) Get(_ context.Context, bucket, key string, opts object.GetOptions) (object.ObjectMeta, []byte, error)

Get implements object.Store.

func (*Store) Len

func (s *Store) Len() int

Len returns object count.

func (*Store) List

func (s *Store) List(_ context.Context, bucket string, opts object.ListOptions) ([]object.ObjectMeta, error)

List implements object.Store.

func (*Store) Put

func (s *Store) Put(_ context.Context, bucket, key string, body []byte, opts object.PutOptions) (object.ObjectMeta, error)

Put implements object.Store.

Jump to

Keyboard shortcuts

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