memory

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package memory is the in-memory CodebaseSource: a map of root-relative paths to contents, with no version control. It is the codebase family's default kind and the file fixture a check's unit test runs on.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Source

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

Source serves files from a map.

func New

func New(files map[string]string) *Source

New returns a Source over a copy of files.

func (*Source) Changed

func (s *Source) Changed(context.Context, string) (map[string]bool, error)

Changed returns an empty set: the source has no version control.

func (*Source) List

func (s *Source) List(context.Context) ([]types.File, error)

List returns every path, sorted.

func (*Source) Read

func (s *Source) Read(_ context.Context, p string) ([]byte, error)

Read returns a path's contents; a missing path is CodeNotFound.

Jump to

Keyboard shortcuts

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