memory

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package memory implements an in-memory backend for testing and development.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

Backend is an in-memory implementation of backend.Backend.

func New

func New() *Backend

New creates a new in-memory Backend.

func (*Backend) Delete

func (b *Backend) Delete(ctx context.Context, path string) error

Delete implements backend.Backend.

func (*Backend) DeleteIf

func (b *Backend) DeleteIf(
	ctx context.Context,
	path string,
	expected backend.Version,
) error

DeleteIf implements backend.Backend.

func (*Backend) GetMetadata

func (b *Backend) GetMetadata(
	ctx context.Context,
	path string,
) (backend.Metadata, error)

GetMetadata implements backend.Backend.

func (*Backend) List

func (b *Backend) List(ctx context.Context, dirPath string) (backend.ListIter, error)

List implements backend.Backend.

func (*Backend) Read

func (b *Backend) Read(ctx context.Context, path string) (backend.ReadReply, error)

func (*Backend) ReadIfModified

func (b *Backend) ReadIfModified(
	ctx context.Context,
	path string,
	version int64,
) (backend.ReadReply, error)

ReadIfModified implements backend.Backend.

func (*Backend) SetTagsIf

func (b *Backend) SetTagsIf(
	ctx context.Context,
	path string,
	expected backend.Version,
	t backend.Tags,
) (backend.Metadata, error)

SetTagsIf implements backend.Backend.

func (*Backend) Write

func (b *Backend) Write(
	ctx context.Context,
	path string,
	value []byte,
	t backend.Tags,
) (backend.Metadata, error)

func (*Backend) WriteIf

func (b *Backend) WriteIf(
	ctx context.Context,
	path string,
	value []byte,
	expected backend.Version,
	t backend.Tags,
) (backend.Metadata, error)

WriteIf implements backend.Backend.

func (*Backend) WriteIfNotExists

func (b *Backend) WriteIfNotExists(
	ctx context.Context,
	path string,
	value []byte,
	t backend.Tags,
) (backend.Metadata, error)

WriteIfNotExists implements backend.Backend.

Jump to

Keyboard shortcuts

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