io

package
v0.0.0-...-bdaa9f3 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindFilesForPath

func FindFilesForPath(path string, fileCheckFun fileCheckFunction) ([]string, error)

Types

type File

type File struct {
	FilePath string
}

File represents a file that can be loaded from the file system

func (File) Load

func (f File) Load() ([]byte, error)

func (File) Path

func (f File) Path() string

type FileGeneratorFunc

type FileGeneratorFunc func() ([]FileObj, error)

FileGeneratorFunc returns a list of files that can be loaded and processed

var StdInGenerator FileGeneratorFunc = func() ([]FileObj, error) {
	stat, err := os.Stdin.Stat()
	if err != nil {
		return nil, err
	}
	if (stat.Mode() & os.ModeCharDevice) == 0 {
		return []FileObj{stdInFile{}}, nil
	}
	return []FileObj{}, nil
}

func FilesInPathsGenerator

func FilesInPathsGenerator(paths []string, fileCheckFun fileCheckFunction) FileGeneratorFunc

func GoFilesInPathsGenerator

func GoFilesInPathsGenerator(paths []string) FileGeneratorFunc

func (FileGeneratorFunc) Combine

type FileObj

type FileObj interface {
	Load() ([]byte, error)
	Path() string
}

FileObj allows mocking the access to files

Jump to

Keyboard shortcuts

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