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 FilePBReader ¶
FilePBReader provides a generic file-reading interface for reading file protos.
func NewLocalFilePBReader ¶
func NewLocalFilePBReader(dirOverride string) FilePBReader
NewLocalFilePBReader creates a local-filesystem based file reader.
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 ClusterComponent 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 LocalFilePBReader ¶
type LocalFilePBReader 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 }
LocalFilePBReader is File proto reader that defers to another FileReader that reads based on paths.
func (*LocalFilePBReader) ReadFilePB ¶
ReadFilePB reads a file proto 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 }
RealFileReaderWriter 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.