iox

package
v0.29.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FullPermAccess         = 0o755
	UserGroupPerm          = 0o750
	FullRWPermAccess       = 0o600
	RWPermAccess           = 0o644
	RWPermAccessPermissive = 0o666
)

Variables

View Source
var (
	ErrEmptyFile = errors.New("trimming buffer resulted in an empty file")
)
View Source
var ErrWriterTransform = errors.New("writer transform error")

Functions

func AppendToFile

func AppendToFile(s, target string) error

func CheckDirIsEmpty

func CheckDirIsEmpty(target string) error

func CopyBufferToFile

func CopyBufferToFile(b bytes.Buffer, target string) error

func CopyFile

func CopyFile(src, dst string) error

func CopyRecursive

func CopyRecursive(src fs.FS, dest string) error

func EnsureDir

func EnsureDir(fileName string) error

EnsureDir creates the directories to host the file. Example: hello/world.md will create the hello dir if it does not exist.

func MultiWriterTransform

func MultiWriterTransform(writers ...WriterTransform) io.Writer

func WriteFile

func WriteFile(target string, data []byte) error

Types

type NullWriter

type NullWriter struct{}

func NewNullWriter

func NewNullWriter() *NullWriter

func (*NullWriter) Write

func (*NullWriter) Write(_ []byte) (int, error)

type Prompter

type Prompter struct {
	Reader *bufio.Reader
}

func NewPrompter

func NewPrompter(r *bufio.Reader) *Prompter

func (*Prompter) Ask

func (p *Prompter) Ask(w string) (bool, error)

type WriterTransform

type WriterTransform struct {
	W          io.Writer
	Transforms []bytesx.TransformFunc
}

Jump to

Keyboard shortcuts

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