osfs

package module
v0.0.0-...-3f44575 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 9 Imported by: 0

README

osfs

This is a package abstracting away the filesystem. The main problem this package tries to tackle is to introduce permission handling for Windows. It is currently not possible to correctly handle Chown/Chmod permissions on Windows, as the functions os.Chown and os.Chmod work with integer uids and gids. Windows does not have integer ids but uses a string representation for their SIDs (S-0-1-2-3).

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNoOpFs

func NewNoOpFs() fsi.Fs

Types

type NoOpFs

type NoOpFs struct{}

NoOpFs does nothing

func (NoOpFs) Chmod

func (NoOpFs) Chmod(name string, mode fs.FileMode) error

func (NoOpFs) Chown

func (NoOpFs) Chown(name string, username, group string) error

func (NoOpFs) Chtimes

func (NoOpFs) Chtimes(name string, atime time.Time, mtime time.Time) error

func (NoOpFs) Create

func (NoOpFs) Create(name string) (fsi.File, error)

func (NoOpFs) Lchown

func (NoOpFs) Lchown(name string, username, group string) error

func (NoOpFs) Lown

func (NoOpFs) Lown(name string) (username, group string, err error)

func (NoOpFs) Lstat

func (NoOpFs) Lstat(name string) (fs.FileInfo, error)

func (NoOpFs) Mkdir

func (NoOpFs) Mkdir(name string, perm fs.FileMode) error

func (NoOpFs) MkdirAll

func (NoOpFs) MkdirAll(path string, perm fs.FileMode) error

func (NoOpFs) Name

func (NoOpFs) Name() string

func (NoOpFs) Open

func (NoOpFs) Open(name string) (fsi.File, error)

func (NoOpFs) OpenFile

func (NoOpFs) OpenFile(name string, flag int, perm fs.FileMode) (fsi.File, error)

func (NoOpFs) Own

func (NoOpFs) Own(name string) (username, group string, err error)
func (NoOpFs) Readlink(name string) (string, error)

func (NoOpFs) Remove

func (NoOpFs) Remove(name string) error

func (NoOpFs) RemoveAll

func (NoOpFs) RemoveAll(path string) error

func (NoOpFs) Rename

func (NoOpFs) Rename(oldname, newname string) error

func (NoOpFs) Stat

func (NoOpFs) Stat(name string) (fs.FileInfo, error)
func (NoOpFs) Symlink(oldname, newname string) error

type OsFs

type OsFs struct{}

func New

func New() *OsFs

func (*OsFs) Chmod

func (ofs *OsFs) Chmod(name string, mode fs.FileMode) error

func (*OsFs) Chown

func (ofs *OsFs) Chown(name string, uid, gid string) error

func (*OsFs) Chtimes

func (ofs *OsFs) Chtimes(name string, atime time.Time, mtime time.Time) error

func (*OsFs) Create

func (ofs *OsFs) Create(name string) (fsi.File, error)

func (*OsFs) Lchown

func (ofs *OsFs) Lchown(name string, uid, gid string) error

func (*OsFs) Lown

func (ofs *OsFs) Lown(name string) (uid, gid string, err error)

func (*OsFs) Lstat

func (ofs *OsFs) Lstat(name string) (os.FileInfo, error)

func (*OsFs) Mkdir

func (ofs *OsFs) Mkdir(name string, perm fs.FileMode) (err error)

func (*OsFs) MkdirAll

func (ofs *OsFs) MkdirAll(name string, perm fs.FileMode) (err error)

func (*OsFs) Name

func (*OsFs) Name() string

func (*OsFs) Open

func (ofs *OsFs) Open(name string) (fsi.File, error)

func (*OsFs) OpenFile

func (ofs *OsFs) OpenFile(name string, flag int, perm fs.FileMode) (fsi.File, error)

func (*OsFs) Own

func (ofs *OsFs) Own(name string) (uid, gid string, err error)
func (ofs *OsFs) Readlink(name string) (string, error)

func (*OsFs) Remove

func (ofs *OsFs) Remove(name string) error

func (*OsFs) RemoveAll

func (ofs *OsFs) RemoveAll(path string) error

func (*OsFs) Rename

func (ofs *OsFs) Rename(oldname, newname string) error

func (*OsFs) Stat

func (ofs *OsFs) Stat(name string) (os.FileInfo, error)
func (ofs *OsFs) Symlink(oldname, newname string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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