iox

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentCache

type ContentCache interface {
	Get(filename string) ([]byte, error)
}

Cache of contents of files.

type FileContentCache

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

func NewFileContentCache

func NewFileContentCache() *FileContentCache

func (*FileContentCache) Get

func (c *FileContentCache) Get(filename string) ([]byte, error)

type FileSource

type FileSource struct {
	*ReaderSource
}

func NewFileSource

func NewFileSource(filename string) (*FileSource, error)

type PathWalker

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

func NewPathWalker

func NewPathWalker(root string) *PathWalker

NewPathWalker returns a Walker that walks the file tree.

func (PathWalker) Walk

func (w PathWalker) Walk() iter.Seq[*WalkerEntry]

type ReaderSource

type ReaderSource struct {
	io.ReadCloser
}

func NewReaderSource

func NewReaderSource(r io.ReadCloser) *ReaderSource

func NewReaderSourceFromReader

func NewReaderSourceFromReader(r io.Reader) *ReaderSource

func (*ReaderSource) AsReadCloser

func (r *ReaderSource) AsReadCloser() io.ReadCloser

func (*ReaderSource) ReadAll

func (r *ReaderSource) ReadAll() ([]byte, error)

type ReaderWalker

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

func NewReaderWalker

func NewReaderWalker(r io.Reader) *ReaderWalker

NewReaderWalker returns a Walker that walks the paths from the io.Reader.

func (*ReaderWalker) Walk

func (w *ReaderWalker) Walk() iter.Seq[*WalkerEntry]

type Source

type Source interface {
	ReadAll() ([]byte, error)
	AsReadCloser() io.ReadCloser
}

func NewFileOrStringSource

func NewFileOrStringSource(s string) (Source, error)

type StdinSource

type StdinSource struct {
	*ReaderSource
}

func NewStdinSource

func NewStdinSource() *StdinSource

type StringSource

type StringSource struct {
	*ReaderSource
}

func NewStringSource

func NewStringSource(s string) *StringSource

type Walker

type Walker interface {
	Walk() iter.Seq[*WalkerEntry]
}

type WalkerEntry

type WalkerEntry struct {
	Path    string // rel path
	Size    int64
	Mode    fs.FileMode
	ModTime time.Time
	IsDir   bool
}

Jump to

Keyboard shortcuts

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