fs

package
v0.0.38 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package fs is the plain-directory CodebaseSource: every file under a root, except the `.git` directory, with no version control.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadFile

func ReadFile(root, p string) ([]byte, error)

ReadFile reads the repository-relative path p under root through an os.Root; a missing file is CodeNotFound and a path escaping the root CodeInvalidInput.

Types

type Source

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

Source serves the files under a root directory.

func New

func New(root string) *Source

New returns a Source rooted at root. It does no I/O.

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(ctx context.Context) ([]types.File, error)

List walks root, skipping `.git`, and returns every regular file, sorted.

func (*Source) Read

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

Read reads one file through an os.Root, so a path can never escape the root; a missing file is CodeNotFound.

Jump to

Keyboard shortcuts

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