fs

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: Apache-2.0 Imports: 5 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemoveContents

func RemoveContents(dir string) error

RemoveContents removes the contents of the specified directory

Types

type FileReaderIter

type FileReaderIter interface {
	// Current returns a slice of bytes for the current chunk read
	// the return value is only valid until Next() is called next
	Current() []byte

	// Next returns a flag to indicate if the iterator was able to
	// read the next chunk of data
	Next() bool

	// Err returns if the reader ran into an error
	Err() error

	// Checksum returns the running checksum
	Checksum() uint32

	// Close releases any releases held by the iter
	Close() error
}

FileReaderIter is an iterator interface over a file

func NewBytesReaderIter

func NewBytesReaderIter(bytes []byte) FileReaderIter

NewBytesReaderIter creates a new FileReaderIter to iterate over a fixed byte slice.

func NewFileReaderIter

func NewFileReaderIter(
	filepath string,
) (FileReaderIter, error)

NewFileReaderIter creates a new buffered FileReaderIter

func NewSizedFileReaderIter

func NewSizedFileReaderIter(
	filepath string,
	bufferSize int,
) (FileReaderIter, error)

NewSizedFileReaderIter creates a new buffered FileReaderIter

Directories

Path Synopsis
Package fs is a generated GoMock package.
Package fs is a generated GoMock package.

Jump to

Keyboard shortcuts

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