filex

package
v0.0.0-...-e8daaa7 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(name string, data []byte, options ...AppendOptionsFn) (int, error)

func Exists

func Exists(name string) bool

func ExistsErr

func ExistsErr(name string) (bool, error)

func Lines

func Lines(filePath string) (lines []string, err error)

Lines read file into lines.

func LinesChan

func LinesChan(filePath string, chSize int) (ch chan string, err error)

LinesChan read file into lines.

func Open

func Open(f string) *os.File

Open opens file successfully or panic.

func ScanLines

func ScanLines(data []byte, atEOF bool) (advance int, token []byte, err error)

ScanLines is a split function for a Scanner that returns each line of text, with end-of-line marker. The returned line may be empty. The end-of-line marker is one optional carriage return followed by one mandatory newline. In regular expression notation, it is `\r?\n`. The last non-empty line of input will be returned even if it has no newline.

Types

type AppendOptions

type AppendOptions struct {
	BackOffset int64
}

type AppendOptionsFn

type AppendOptionsFn func(*AppendOptions)

func WithBackOffset

func WithBackOffset(backOffset int64) AppendOptionsFn

Jump to

Keyboard shortcuts

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