Documentation ¶
Index ¶
- Constants
- Variables
- func AppendToFile(s, target string) error
- func CheckDirIsEmpty(target string) error
- func CopyBufferToFile(b bytes.Buffer, target string) error
- func CopyFile(src, dst string) error
- func CopyRecursive(src fs.FS, dest string) error
- func EnsureDir(fileName string) error
- func MultiWriterTransform(writers ...WriterTransform) io.Writer
- func WriteFile(target string, data []byte) error
- type NullWriter
- type Prompter
- type WriterTransform
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 CheckDirIsEmpty ¶
func EnsureDir ¶
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
Types ¶
type Prompter ¶
func NewPrompter ¶
type WriterTransform ¶
type WriterTransform struct { W io.Writer Transforms []bytesx.TransformFunc }
Click to show internal directories.
Click to hide internal directories.