fs

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileAppender

type FileAppender interface {
	FileWriter
}

type FileReader

type FileReader interface {
	Err() error
	Info() os.FileInfo
	String() string
	Lines() []string
	Bytes() []byte
	WriteTo(io.Writer) FileReader
}

func Read

func Read(path string) FileReader

Read creates a file reader; it stat(path) to ensure it already exists, if not FileReader.err is filled.

type FileWriter

type FileWriter interface {
	Err() error
	Info() os.FileInfo
	String(string) FileWriter
	Lines([]string) FileWriter
	Bytes([]byte) FileWriter
	ReadFrom(io.Reader) FileWriter
}

func Append

func Append(path string) FileWriter

func Write

func Write(path string) FileWriter

Write creates a new file or truncates an existing one and sets it up for writing.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL