Documentation ¶
Index ¶
- func Diff(from, to, originalFileContent, newFileContent string) string
- func IsURL(location string) bool
- func Show(content string) (result string)
- type MockTextRetriever
- func (mtr *MockTextRetriever) FileExists(location string) bool
- func (mtr *MockTextRetriever) ReadAll(location string) (string, error)
- func (mtr *MockTextRetriever) ReadLine(location string, line int) (string, error)
- func (mtr *MockTextRetriever) WriteLineToFile(lineContent, location string, lineNumber int) error
- func (mtr *MockTextRetriever) WriteToFile(content string, location string) error
- type Text
- func (t *Text) FileExists(location string) bool
- func (t *Text) ReadAll(location string) (string, error)
- func (t *Text) ReadLine(location string, line int) (string, error)
- func (t *Text) WriteLineToFile(lineContent, location string, lineNumber int) (err error)
- func (t *Text) WriteToFile(content string, location string) error
- type TextRetriever
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MockTextRetriever ¶ added in v0.13.0
MockTextRetriever is a stub implementation of the `TextRetriever` interface to be used in our unit test suites. It stores the expected Content and Err
func (*MockTextRetriever) FileExists ¶ added in v0.13.0
func (mtr *MockTextRetriever) FileExists(location string) bool
func (*MockTextRetriever) ReadAll ¶ added in v0.13.0
func (mtr *MockTextRetriever) ReadAll(location string) (string, error)
func (*MockTextRetriever) ReadLine ¶ added in v0.13.0
func (mtr *MockTextRetriever) ReadLine(location string, line int) (string, error)
func (*MockTextRetriever) WriteLineToFile ¶ added in v0.13.0
func (mtr *MockTextRetriever) WriteLineToFile(lineContent, location string, lineNumber int) error
func (*MockTextRetriever) WriteToFile ¶ added in v0.13.0
func (mtr *MockTextRetriever) WriteToFile(content string, location string) error
type Text ¶ added in v0.13.0
type Text struct{}
func (*Text) FileExists ¶ added in v0.13.0
func (*Text) ReadAll ¶ added in v0.13.0
ReadAll reads text content from a location (URL or filepath). The location accepts multiple input strings: starting with either "http://", "https://", or file url "file://" or filepath (default)
func (*Text) ReadLine ¶ added in v0.13.0
ReadLine reads the specified line of text from the specified location (URL or filepath). The location accepts multiple input strings: starting with either "http://", "https://", or file url "file://" or filepath (default)
func (*Text) WriteLineToFile ¶ added in v0.13.0
WriteLineToFile writes 'lineContent' to the line number 'lineNumber' in the file at 'location'