file

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadJsonData

func ReadJsonData[T any](t testing.TB, input io.Reader) []T

func ReadJsonLine

func ReadJsonLine[T any](t testing.TB, input io.Reader) func() (T, bool)

func ReadLines

func ReadLines(t testing.TB, input io.Reader) []string

func ReadLinesInBytes

func ReadLinesInBytes(t testing.TB, input io.Reader) [][]byte

func TempJsonLogFile

func TempJsonLogFile(t testing.TB, modifiers ...Modifier) *os.File

#nosec 304

Types

type Modifier

type Modifier func(*fileConfig)

func Append

func Append() Modifier

Append Set Append flag to a file

func Create

func Create() Modifier

func ReadOnly

func ReadOnly() Modifier

ReadOnly Mark file as read only

func ReadWrite

func ReadWrite() Modifier

ReadWrite Mark file as read-write

func Truncate

func Truncate() Modifier

Truncate Mark file as truncate

func WithDirectory

func WithDirectory(dir string) Modifier

WithDirectory set directory

func WithName

func WithName(name string) Modifier

WithName set file name

func WithPermissions

func WithPermissions(perms os.FileMode) Modifier

func WriteOnly

func WriteOnly() Modifier

WriteOnly Mark file as write-only

Jump to

Keyboard shortcuts

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