file

package
v2.2.0-beta.2+incompat... Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidFilePath = errors.New("invalid filepath")
)

Package specific errors:

Functions

func IsNotExist

func IsNotExist(err error) bool

IsNotExist is a wrapper for os.IsNotExist.

Types

type FSFile

type FSFile struct {
	// contains filtered or unexported fields
}

FSFile represents a filesystem file.

func New

func New(path string, fm os.FileMode) (*FSFile, error)

New creates the new FSFile from specified file path and permissions.

func (FSFile) Info

func (f FSFile) Info() string

Info describes a file path.

func (FSFile) Read

func (f FSFile) Read() ([]byte, error)

Read reads the file on provided path and returns the contents.

func (FSFile) Write

func (f FSFile) Write(data []byte) error

Write stores data to file. If the file does not exist it will be created, otherwise it truncates the file before writing.

Jump to

Keyboard shortcuts

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