Documentation ¶
Index ¶
- type FSInfo
- type FSPath
- type FileReader
- func (fr *FileReader) Bytes() []byte
- func (fr *FileReader) Err() error
- func (fr *FileReader) Info() os.FileInfo
- func (fr *FileReader) Into(w io.Writer) *FileReader
- func (fr *FileReader) Lines() []string
- func (fr *FileReader) SetContext(ctx context.Context) *FileReader
- func (fr *FileReader) SetVars(variables *vars.Variables) *FileReader
- func (fr *FileReader) String() string
- type FileWriter
- func Append(path string) *FileWriter
- func AppendWitVars(path string, variables *vars.Variables) *FileWriter
- func AppendWithContextVars(ctx context.Context, path string, variables *vars.Variables) *FileWriter
- func Write(path string) *FileWriter
- func WriteWithContextVars(ctx context.Context, path string, variables *vars.Variables) *FileWriter
- func WriteWithVars(path string, variables *vars.Variables) *FileWriter
- func (fw *FileWriter) Bytes(data []byte) *FileWriter
- func (fw *FileWriter) Err() error
- func (fw *FileWriter) From(r io.Reader) *FileWriter
- func (fw *FileWriter) Info() os.FileInfo
- func (fw *FileWriter) Lines(lines []string) *FileWriter
- func (fw *FileWriter) SetVars(variables *vars.Variables) *FileWriter
- func (fw *FileWriter) String(str string) *FileWriter
- func (fw *FileWriter) WithContext(ctx context.Context) *FileWriter
- func (fw *FileWriter) WithMode(mode os.FileMode) *FileWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FSInfo ¶ added in v0.3.0
type FSInfo struct {
// contains filtered or unexported fields
}
type FSPath ¶ added in v0.3.0
type FSPath struct {
// contains filtered or unexported fields
}
func PathWithVars ¶ added in v0.3.0
PathWithVars points to a path and applies variables to the path value
func (*FSPath) Append ¶ added in v0.3.0
func (p *FSPath) Append() *FileWriter
Append wraps call to create a new *FileWriter instance for file append operations
func (*FSPath) Exists ¶ added in v0.3.0
Exists returns true only if os.Stat nil error. Any other scenarios will return false.
func (*FSPath) Read ¶ added in v0.3.0
func (p *FSPath) Read() *FileReader
Read wraps call to create a new *FileReader instance
func (*FSPath) Write ¶ added in v0.3.0
func (p *FSPath) Write() *FileWriter
Write wraps call to create a new *FileWriter instance
type FileReader ¶
type FileReader struct {
// contains filtered or unexported fields
}
func Read ¶
func Read(path string) *FileReader
Read reads the file at path and returns FileReader to access its content
func ReadWithContextVars ¶ added in v0.4.1
ReadWithContextVars uses specified context and session variables to read the file at path and returns a *FileReader to access its content
func ReadWithVars ¶ added in v0.3.0
func ReadWithVars(path string, variables *vars.Variables) *FileReader
ReadWithVars uses session variables to create a new FileReader
func (*FileReader) Bytes ¶
func (fr *FileReader) Bytes() []byte
Bytes returns the content of the file as []byte
func (*FileReader) Err ¶
func (fr *FileReader) Err() error
Err returns an operation error during file read.
func (*FileReader) Info ¶
func (fr *FileReader) Info() os.FileInfo
Info surfaces the os.FileInfo for the associated file
func (*FileReader) Into ¶ added in v0.1.1
func (fr *FileReader) Into(w io.Writer) *FileReader
Into reads the content of the file and writes it into the specified Writer
func (*FileReader) Lines ¶
func (fr *FileReader) Lines() []string
Lines returns the content of the file as slice of string
func (*FileReader) SetContext ¶ added in v0.4.1
func (fr *FileReader) SetContext(ctx context.Context) *FileReader
SetContext sets the context for the FileReader operations
func (*FileReader) SetVars ¶ added in v0.3.0
func (fr *FileReader) SetVars(variables *vars.Variables) *FileReader
SetVars sets the FileReader's session variables
func (*FileReader) String ¶
func (fr *FileReader) String() string
String returns the content of the file as a string value
type FileWriter ¶
type FileWriter struct {
// contains filtered or unexported fields
}
func Append ¶
func Append(path string) *FileWriter
Append creates FileWriter to write content to file at path
func AppendWitVars ¶ added in v0.3.0
func AppendWitVars(path string, variables *vars.Variables) *FileWriter
AppendWithVars uses the specified session variables to create a FileWriter to write content to file at path.
func AppendWithContextVars ¶ added in v0.4.1
AppendWithContextVars uses the specified context and session variables to create a new FileWriter that can be used to append content existing file at path. The file will be open with:
os.O_CREATE | os.O_APPEND | os.O_WRONLY
and mode 0644
func Write ¶
func Write(path string) *FileWriter
Write creates a new FileWriter to write file content
func WriteWithContextVars ¶ added in v0.4.1
WriteWithVars uses the specified context and session variables to create a new FileWriter that can be used to write content to file at path. The file will be created with:
os.O_CREATE | os.O_TRUNC | os.O_WRONLY
func WriteWithVars ¶ added in v0.3.0
func WriteWithVars(path string, variables *vars.Variables) *FileWriter
WriteWithVars uses sesison variables to create a new FileWriter to write content to file
func (*FileWriter) Bytes ¶
func (fw *FileWriter) Bytes(data []byte) *FileWriter
Bytes writes the []bytre provided into the file. Any error can be accessed using FileWriter.Err().
func (*FileWriter) Err ¶
func (fw *FileWriter) Err() error
Err returns FileWriter error during execution
func (*FileWriter) From ¶ added in v0.1.1
func (fw *FileWriter) From(r io.Reader) *FileWriter
From streams bytes from the provided io.Reader r and writes them to the file. Any error will be captured and returned by fw.Err().
func (*FileWriter) Info ¶
func (fw *FileWriter) Info() os.FileInfo
Info returns the os.FileInfo for the associated file
func (*FileWriter) Lines ¶
func (fw *FileWriter) Lines(lines []string) *FileWriter
Lines writes the slice of strings into the file. Any error will be captured and returned via FileWriter.Err().
func (*FileWriter) SetVars ¶ added in v0.3.0
func (fw *FileWriter) SetVars(variables *vars.Variables) *FileWriter
SetVars sets session variables for FileWriter
func (*FileWriter) String ¶
func (fw *FileWriter) String(str string) *FileWriter
String writes the provided str into the file. Any error that occurs can be accessed with FileWriter.Err().
func (*FileWriter) WithContext ¶ added in v0.4.1
func (fw *FileWriter) WithContext(ctx context.Context) *FileWriter
WithContext sets an execution context for the FileWriter operations
func (*FileWriter) WithMode ¶ added in v0.3.0
func (fw *FileWriter) WithMode(mode os.FileMode) *FileWriter