Documentation ¶
Overview ¶
Package files contains methods and data types for manipulating files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileObjReader ¶ added in v0.5.0
FileObjReader provides a generic file-reading interface for reading file objects
type FileReader ¶
FileReader is a common command interface for reading files.
type FileReaderWriter ¶
type FileReaderWriter interface { FileReader FileWriter }
FileReaderWriter combines both file reading and file writing.
type FileWriter ¶
type FileWriter interface { // WriteFile writes a Component or Bundle to the given file path. WriteFile(ctx context.Context, path string, bytes []byte, permissions os.FileMode) error }
FileWriter is an interface for writing files. This interface is used by the export and patch commands in this package. There is a fake implementation in the testing package.
type LocalFileObjReader ¶ added in v0.5.0
type LocalFileObjReader struct { // WorkingDir specifies a working directory override. This is necessary // because paths for inlined files are specified relative to the bundle, not // the working directory of the user. // // TODO(kashomon): Get rid of this. Path manipulation should happen in the // downstream libraries. WorkingDir string // Rdr is a FileReader object. Rdr FileReader }
LocalFileObjReader is File object reader that defers to another FileReader that reads based on paths.
func (*LocalFileObjReader) ReadFileObj ¶ added in v0.5.0
ReadFileObj reads a file object from the local filesystem by deferring to a local file reader.
type LocalFileSystemReader ¶
type LocalFileSystemReader struct{}
LocalFileSystemReader implements the FileReader interface and reads files from the local filesystem.
type LocalFileSystemReaderWriter ¶
type LocalFileSystemReaderWriter struct { LocalFileSystemReader LocalFileSystemWriter }
LocalFileSystemReaderWriter combines both local file system file reading and writing.
type LocalFileSystemWriter ¶
type LocalFileSystemWriter struct{}
LocalFileSystemWriter implements the ComponentWriter interface and writes apps to the local filesystem.