writefs

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MkDir

func MkDir(fsys fs.FS, name string, perm fs.FileMode) error

MkDir creates a new directory with the specified name and permission bits. If there is an error, it will be of type *PathError. If fsys implements MkDirFS, MkDir calls fsys.MkDir. Otherwise MkDir calls fsys.OpenFile with a fs.O_DIR argument and fs.O_CREATE

func Remove

func Remove(fsys fs.FS, name string) error

Remove creates a new directory with the specified name and permission bits. If there is an error, it will be of type *PathError. If fsys implements RemoveFS, Remove calls fsys.Remove. Otherwise Remove calls fsys.OpenFile with a fs.O_DIR argument and fs.O_CREATE

func WriteFile

func WriteFile(fsys fs.FS, name string, buf []byte) (n int, err error)

WriteFile ...

Types

type FileWriter

type FileWriter interface {
	fs.File
	io.Writer
}

FileWriter ...

func OpenFile

func OpenFile(fsInst fs.FS, name string, flag int, perm fs.FileMode) (FileWriter, error)

OpenFile ...

type MkDirFS

type MkDirFS interface {
	fs.FS
	MkDir(name string, perm fs.FileMode) error
}

MkDirFS is the interface implemented by a file system that provides an optimized implementation of MkDir.

type ReadOnlyWriteFile

type ReadOnlyWriteFile struct {
	fs.File
}

ReadOnlyWriteFile ...

func (ReadOnlyWriteFile) Write

func (f ReadOnlyWriteFile) Write(p []byte) (n int, err error)

type RemoveFS

type RemoveFS interface {
	fs.FS
	Remove(name string) error
}

RemoveFS is the interface implemented by a file system that provides an optimized implementation of Remove.

type WriteFS

type WriteFS interface {
	fs.FS
	OpenFile(name string, flag int, perm fs.FileMode) (FileWriter, error)
}

WriteFS ...

Jump to

Keyboard shortcuts

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