writefs

package
v3.0.40 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2025 License: Apache-2.0 Imports: 14 Imported by: 20

Documentation

Index

Constants

View Source
const (
	LowFS levelFS = iota
	MediumFS
	HighFS
)

Variables

View Source
var ErrNotImplemented = errors.NewPlain("not implemented")

Functions

func Close

func Close(fsys fs.FS) error

func Copy added in v3.0.9

func Copy(srcFS fs.FS, src string, dstFS fs.FS, dst string) (int64, error)

func Equal added in v3.0.22

func Equal(fsys1, fsys2 fs.FS) bool

func Fullpath

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

func HasContent

func HasContent(fsys fs.FS) bool

func Join added in v3.0.23

func Join(fsys fs.FS, elems ...string) string

func MkDir

func MkDir(fsys fs.FS, path string) error

func NewDirEntry

func NewDirEntry(info fs.FileInfo) *dirEntry

NewDirEntry creates a new DirEntry from a FileInfo.

func NewFileInfoDir

func NewFileInfoDir(base string) *fileInfoDir

NewFileInfoDir creates a new FileInfo for a directory.

func NewNopReadCloser

func NewNopReadCloser(r io.Reader) io.ReadCloser

NopReadCloser returns a ReadCloser with a no-op Close method wrapping

func NewNopWriteCloser

func NewNopWriteCloser(w io.Writer) io.WriteCloser

func NewSidecarAESWriter

func NewSidecarAESWriter(w io.Writer, aesWriter io.WriteCloser) (io.WriteCloser, error)

func NewSidecarChecksumWriter

func NewSidecarChecksumWriter(w io.Writer, sidecars map[checksum.DigestAlgorithm]io.WriteCloser) (io.WriteCloser, error)

func Remove

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

func Rename

func Rename(fsys fs.FS, oldPath, newPath string) error

func Sub added in v3.0.22

func Sub(fsys fs.FS, dir string) (fs.FS, error)

func SubFSCreate

func SubFSCreate(fsys fs.FS, path string) (fs.FS, error)

func WriteFile

func WriteFile(fsys fs.FS, name string, data []byte) (int64, error)

Types

type AppendFS added in v3.0.19

type AppendFS interface {
	Append(path string) (FileWrite, error)
}

type CloseFS

type CloseFS interface {
	Close() error
}

type CopyFS added in v3.0.20

type CopyFS interface {
	Copy(dst, src string) (int64, error)
}

type CreateFS

type CreateFS interface {
	Create(path string) (FileWrite, error)
}

type CreateFSFunc

type CreateFSFunc func(f *Factory, path string, readOnly bool) (fs.FS, error)

type EqualFS added in v3.0.22

type EqualFS interface {
	Equal(fsys fs.FS) bool
}

type Factory

type Factory struct {
	// contains filtered or unexported fields
}

func NewFactory

func NewFactory() (*Factory, error)

func (*Factory) Get

func (f *Factory) Get(path string, readOnly bool) (fs.FS, error)

func (*Factory) Register

func (f *Factory) Register(create CreateFSFunc, identifyRegex string, level levelFS) error

type FileWrite

type FileWrite interface {
	io.WriteCloser
}

func Append added in v3.0.20

func Append(fsys fs.FS, path string) (FileWrite, error)

func Create

func Create(fsys fs.FS, path string) (FileWrite, error)

type FileWriteSeeker

type FileWriteSeeker interface {
	FileWrite
	io.Seeker
}

type FileWriterAt

type FileWriterAt interface {
	FileWrite
	io.WriterAt
}

type FullpathFS

type FullpathFS interface {
	Fullpath(name string) (string, error)
}

type IsLockedFS

type IsLockedFS interface {
	fs.FS
	IsLocked() bool
}

IsLockedFS is a fs.FS that can be checked for being locked.

type JoinFS added in v3.0.23

type JoinFS interface {
	Join(fsys fs.FS, elems ...string) string
}

type MkDirFS

type MkDirFS interface {
	MkDir(path string) error
}

type Mutex

type Mutex struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewMutex

func NewMutex() *Mutex

func (*Mutex) IsLocked

func (m *Mutex) IsLocked() bool

func (*Mutex) Lock

func (m *Mutex) Lock()

func (*Mutex) Unlock

func (m *Mutex) Unlock()

type ReadWriteFS

type ReadWriteFS interface {
	fs.FS
	CreateFS
}

type RemoveFS

type RemoveFS interface {
	Remove(path string) error
}

type RenameFS

type RenameFS interface {
	Rename(oldPath, newPath string) error
}

type WriteFileFS

type WriteFileFS interface {
	WriteFile(name string, data []byte) (int64, error)
}

Jump to

Keyboard shortcuts

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