cgofusewrapper

package
v0.0.0-...-de05cad Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FileType_Directory FileType = fuse.S_IFDIR
	FileType_Link      FileType = fuse.S_IFLNK
	FileType_File      FileType = fuse.S_IFREG

	FilePermissions_Read             FilePermissions = 0444
	FilePermissions_ReadExecute      FilePermissions = 0555
	FilePermissions_ReadWrite        FilePermissions = 0664
	FilePermissions_ReadWriteExecute FilePermissions = 0775
)
View Source
const FileHandleValue = ^uint64(0)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseDir

type BaseDir struct{}

func (*BaseDir) Attr

func (d *BaseDir) Attr(stat *Stat) (FileType, FilePermissions, error)

type BaseFile

type BaseFile struct{}

func (*BaseFile) Attr

func (f *BaseFile) Attr(stat *Stat) (FileType, FilePermissions, error)

type CountedHandle

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

type Dir

type Dir interface {
	Node
	List() ([]string, error)
	Get(string) (Node, error)
}

type ErrorAccessDenied

type ErrorAccessDenied struct {
	Path string
}

func (*ErrorAccessDenied) Error

func (e *ErrorAccessDenied) Error() string

func (*ErrorAccessDenied) ErrorCode

func (e *ErrorAccessDenied) ErrorCode() int

type ErrorNotADirectory

type ErrorNotADirectory struct {
	Path string
}

func (*ErrorNotADirectory) Error

func (e *ErrorNotADirectory) Error() string

func (*ErrorNotADirectory) ErrorCode

func (e *ErrorNotADirectory) ErrorCode() int

type ErrorNotFound

type ErrorNotFound struct {
	Path string
}

func (*ErrorNotFound) Error

func (e *ErrorNotFound) Error() string

func (*ErrorNotFound) ErrorCode

func (e *ErrorNotFound) ErrorCode() int

type ErrorNotImplemented

type ErrorNotImplemented struct{}

func (*ErrorNotImplemented) Error

func (e *ErrorNotImplemented) Error() string

func (*ErrorNotImplemented) ErrorCode

func (e *ErrorNotImplemented) ErrorCode() int

type ErrorUnknown

type ErrorUnknown struct {
	Path    string
	Message string
}

func (*ErrorUnknown) Error

func (e *ErrorUnknown) Error() string

func (*ErrorUnknown) ErrorCode

func (e *ErrorUnknown) ErrorCode() int

type FS

type FS struct {
	Handles  Handles
	Root     Dir
	Readonly bool
}

func (*FS) Access

func (fs *FS) Access(path string, mask uint32) int

Access checks file access permissions.

func (*FS) Chmod

func (fs *FS) Chmod(path string, mode uint32) int

Chmod changes the permission bits of a file.

func (*FS) Chown

func (fs *FS) Chown(path string, uid uint32, gid uint32) int

Chown changes the owner and group of a file.

func (*FS) Create

func (fs *FS) Create(path string, flags int, mode uint32) (int, uint64)

Create creates and opens a file. The flags are a combination of the fuse.O_* constants.

func (*FS) CreateEx

func (fs *FS) CreateEx(path string, flags uint32, fi *fuse.FileInfo_t) int

func (*FS) Destroy

func (fs *FS) Destroy()

Destroy is called when the file system is destroyed.

func (*FS) Flush

func (fs *FS) Flush(path string, fh uint64) int

Flush flushes cached file data.

func (*FS) Fsync

func (fs *FS) Fsync(path string, datasync bool, fh uint64) int

Fsync synchronizes file contents.

func (*FS) Fsyncdir

func (fs *FS) Fsyncdir(path string, datasync bool, fh uint64) int

Fsyncdir synchronizes directory contents.

func (*FS) Getattr

func (fs *FS) Getattr(path string, stat *fuse.Stat_t, fh uint64) int

Getattr gets file attributes.

func (*FS) Getxattr

func (fs *FS) Getxattr(path string, name string) (int, []byte)

Getxattr gets extended attributes.

func (*FS) Init

func (fs *FS) Init()

Init is called when the file system is created.

func (fs *FS) Link(oldpath string, newpath string) int

Link creates a hard link to a file.

func (*FS) Listxattr

func (fs *FS) Listxattr(path string, fill func(name string) bool) int

Listxattr lists extended attributes.

func (*FS) Mkdir

func (fs *FS) Mkdir(path string, mode uint32) int

Mkdir creates a directory.

func (*FS) Mknod

func (fs *FS) Mknod(path string, mode uint32, dev uint64) int

Mknod creates a file node.

func (*FS) Open

func (fs *FS) Open(path string, flags int) (int, uint64)

Open opens a file. The flags are a combination of the fuse.O_* constants.

func (*FS) OpenEx

func (fs *FS) OpenEx(path string, fi *fuse.FileInfo_t) int

func (*FS) Opendir

func (fs *FS) Opendir(path string) (int, uint64)

Opendir opens a directory.

func (*FS) Read

func (fs *FS) Read(path string, buff []byte, offset int64, fh uint64) int

Read reads data from a file.

func (*FS) Readdir

func (fs *FS) Readdir(path string,
	fill func(name string, stat *fuse.Stat_t, ofst int64) bool,
	ofst int64,
	fh uint64) int

Readdir reads a directory.

func (fs *FS) Readlink(path string) (int, string)

Readlink reads the target of a symbolic link.

func (*FS) Release

func (fs *FS) Release(path string, fh uint64) int

Release closes an open file.

func (*FS) Releasedir

func (fs *FS) Releasedir(path string, fh uint64) int

Releasedir closes an open directory.

func (*FS) Removexattr

func (fs *FS) Removexattr(path string, name string) int

Removexattr removes extended attributes.

func (*FS) Rename

func (fs *FS) Rename(oldpath string, newpath string) int

Rename renames a file.

func (*FS) Rmdir

func (fs *FS) Rmdir(path string) int

Rmdir removes a directory.

func (*FS) Setxattr

func (fs *FS) Setxattr(path string, name string, value []byte, flags int) int

Setxattr sets extended attributes.

func (*FS) Statfs

func (fs *FS) Statfs(path string, stat *fuse.Statfs_t) int

Statfs gets file system statistics.

func (fs *FS) Symlink(target string, newpath string) int

Symlink creates a symbolic link.

func (*FS) Truncate

func (fs *FS) Truncate(path string, size int64, fh uint64) (errn int)

Truncate changes the size of a file.

func (fs *FS) Unlink(path string) int

Unlink removes a file.

func (*FS) Utimens

func (fs *FS) Utimens(path string, tmsp []fuse.Timespec) int

Utimens changes the access and modification times of a file.

func (*FS) Write

func (fs *FS) Write(path string, buff []byte, ofst int64, fh uint64) int

Write writes data to a file.

type File

type File interface {
	ReadEntireContents() ([]byte, error)
	Write([]byte) error
	Delete() error
}

type FileHandle

type FileHandle struct {
	File  File
	Data  []byte
	Mutex sync.Mutex
	// contains filtered or unexported fields
}

type FilePermissions

type FilePermissions uint32

type FileType

type FileType uint32

type FuseError

type FuseError interface {
	error
	ErrorCode() int
}

type Handles

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

func (*Handles) CreateOrIncrement

func (h *Handles) CreateOrIncrement(name string, newValue func() (interface{}, error)) error

func (*Handles) Get

func (h *Handles) Get(name string) interface{}

func (*Handles) Release

func (h *Handles) Release(name string) uint

type Node

type Node interface {
	Attr(stat *Stat) (FileType, FilePermissions, error)
}

type Stat

type Stat fuse.Stat_t

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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