Documentation ¶
Index ¶
- func AppendToFile(s string, filename string) error
- func EnsureDir(dir string) error
- func FileExist(path string) bool
- func GetDir(devEnv bool) (string, error)
- func OverwriteFile(s string, filename string) error
- func OverwriteFileBytes(b []byte, filename string) error
- func OverwriteFileValueIndent(v interface{}, filename string) error
- func Write(s string, w io.StringWriter) error
- func WriteBytes(b []byte, w io.Writer) error
- type FileWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendToFile ¶
AppendToFile write s to the end of filename
func OverwriteFile ¶
OverwriteFile truncate filename and write s into it
func OverwriteFileBytes ¶ added in v0.32.1
OverwriteFileBytes truncate filename and write b []bytes into it
func OverwriteFileValueIndent ¶ added in v0.32.1
OverwriteFileValueIndent marshall v into indented json, then truncate the file filename and write the marshalled bytes into it
Types ¶
type FileWriter ¶ added in v0.26.2
FileWriter allows concurrent writes to a file
func (*FileWriter) EnqueueWrite ¶ added in v0.26.2
func (fw *FileWriter) EnqueueWrite(data string) (err error)
EnqueueWrite writes string to the target file
func (*FileWriter) Init ¶ added in v0.26.2
func (fw *FileWriter) Init(filePath string, queueLength int) (err error)
Init setup the FileWriter
func (*FileWriter) Stop ¶ added in v0.26.2
func (fw *FileWriter) Stop() (err error)
Stop ends the file writer
Click to show internal directories.
Click to hide internal directories.