memory

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package memory implements an in-process vfs.Storage with case-insensitive substring search.

Suitable for single-process production use and tests; data is lost on process exit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

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

Storage is the in-memory implementation.

func NewStorage

func NewStorage() *Storage

NewStorage returns an empty in-memory Storage.

func (*Storage) DeleteFile

func (s *Storage) DeleteFile(ctx context.Context, path string) error

func (*Storage) ListFiles

func (s *Storage) ListFiles(ctx context.Context) ([]vfs.FileMeta, error)

func (*Storage) ReadFile

func (s *Storage) ReadFile(ctx context.Context, path string) ([]byte, vfs.FileMeta, error)

func (*Storage) Search

func (s *Storage) Search(ctx context.Context, query string) ([]string, error)

Search performs a case-insensitive substring search against file contents.

Empty query matches every file in the corpus. Returns paths sorted.

func (*Storage) SearchSyntax

func (s *Storage) SearchSyntax() string

SearchSyntax describes the query language this backend accepts.

func (*Storage) WriteFile

func (s *Storage) WriteFile(ctx context.Context, path string, content []byte, contentType string) error

Jump to

Keyboard shortcuts

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