Documentation ¶
Index ¶
- Constants
- Variables
- func IsNameReserved(name string) bool
- func WriteOpCount() uint64
- type CfcryptFS
- func (fs *CfcryptFS) Access(name string, mode uint32, context *fuse.Context) (code fuse.Status)
- func (fs *CfcryptFS) Chmod(path string, mode uint32, context *fuse.Context) (code fuse.Status)
- func (fs *CfcryptFS) Chown(path string, uid uint32, gid uint32, context *fuse.Context) (code fuse.Status)
- func (fs *CfcryptFS) Create(path string, flags uint32, mode uint32, context *fuse.Context) (fuseFile nodefs.File, code fuse.Status)
- func (fs *CfcryptFS) GetAttr(path string, context *fuse.Context) (*fuse.Attr, fuse.Status)
- func (fs *CfcryptFS) GetXAttr(name string, attr string, context *fuse.Context) ([]byte, fuse.Status)
- func (fs *CfcryptFS) Link(orig string, newName string, context *fuse.Context) (code fuse.Status)
- func (fs *CfcryptFS) ListXAttr(name string, context *fuse.Context) ([]string, fuse.Status)
- func (fs *CfcryptFS) Mkdir(path string, mode uint32, context *fuse.Context) (code fuse.Status)
- func (fs *CfcryptFS) Mknod(name string, mode uint32, dev uint32, context *fuse.Context) (code fuse.Status)
- func (fs *CfcryptFS) Open(path string, flags uint32, context *fuse.Context) (fuseFile nodefs.File, status fuse.Status)
- func (fs *CfcryptFS) OpenDir(path string, context *fuse.Context) (stream []fuse.DirEntry, status fuse.Status)
- func (fs *CfcryptFS) Readlink(name string, context *fuse.Context) (out string, code fuse.Status)
- func (fs *CfcryptFS) RemoveXAttr(name string, attr string, context *fuse.Context) fuse.Status
- func (fs *CfcryptFS) Rename(oldPath string, newPath string, context *fuse.Context) (codee fuse.Status)
- func (fs *CfcryptFS) Rmdir(name string, context *fuse.Context) (code fuse.Status)
- func (fs *CfcryptFS) SetXAttr(name string, attr string, data []byte, flags int, context *fuse.Context) fuse.Status
- func (fs *CfcryptFS) StatFs(name string) *fuse.StatfsOut
- func (fs *CfcryptFS) String() string
- func (fs *CfcryptFS) Symlink(pointedTo string, linkName string, context *fuse.Context) (code fuse.Status)
- func (fs *CfcryptFS) Truncate(path string, offset uint64, context *fuse.Context) (code fuse.Status)
- func (fs *CfcryptFS) Unlink(name string, context *fuse.Context) (code fuse.Status)
- func (fs *CfcryptFS) Utimens(path string, a *time.Time, m *time.Time, context *fuse.Context) (code fuse.Status)
- type FsConfig
- type QIno
Constants ¶
View Source
const ( // ConfFile save configurations ConfFile = ".cfcryptfs.cfg" // KeyFile save encrypted key KeyFile = ".cfcryptfs.key" // KeyFileTmp is used when changing pwd KeyFileTmp = ".cfcryptfs.key.tmp" )
Variables ¶
View Source
var ReservedNameMap map[string]bool
ReservedNameMap name -> bool
View Source
var ReservedNames []string
ReservedNames stores names reserved for filesystem
Functions ¶
func WriteOpCount ¶
func WriteOpCount() uint64
WriteOpCount returns the write lock counter value. This value is encremented each time writeLock.Lock() on a file table entry is called.
Types ¶
type CfcryptFS ¶
type CfcryptFS struct { pathfs.FileSystem // CfcryptFS, see go-fuse/fuse/pathfs/loopback.go // contains filtered or unexported fields }
CfcryptFS implements the go-fuse virtual filesystem interface.
func NewFS ¶
func NewFS(confs FsConfig, core corecrypter.CoreCrypter) *CfcryptFS
NewFS returns a new encrypted FUSE overlay filesystem.
func (*CfcryptFS) Chown ¶
func (fs *CfcryptFS) Chown(path string, uid uint32, gid uint32, context *fuse.Context) (code fuse.Status)
Chown implements pathfs.Filesystem.
func (*CfcryptFS) Create ¶
func (fs *CfcryptFS) Create(path string, flags uint32, mode uint32, context *fuse.Context) (fuseFile nodefs.File, code fuse.Status)
Create implements pathfs.Filesystem.
func (*CfcryptFS) GetXAttr ¶
func (fs *CfcryptFS) GetXAttr(name string, attr string, context *fuse.Context) ([]byte, fuse.Status)
GetXAttr fuse implemention
func (*CfcryptFS) Mknod ¶
func (fs *CfcryptFS) Mknod(name string, mode uint32, dev uint32, context *fuse.Context) (code fuse.Status)
Mknod fuse implemention
func (*CfcryptFS) Open ¶
func (fs *CfcryptFS) Open(path string, flags uint32, context *fuse.Context) (fuseFile nodefs.File, status fuse.Status)
Open implements pathfs.Filesystem.
func (*CfcryptFS) OpenDir ¶
func (fs *CfcryptFS) OpenDir(path string, context *fuse.Context) (stream []fuse.DirEntry, status fuse.Status)
OpenDir fuse implemention
func (*CfcryptFS) RemoveXAttr ¶
RemoveXAttr fuse implemention
func (*CfcryptFS) Rename ¶
func (fs *CfcryptFS) Rename(oldPath string, newPath string, context *fuse.Context) (codee fuse.Status)
Rename fuse implemention
func (*CfcryptFS) SetXAttr ¶
func (fs *CfcryptFS) SetXAttr(name string, attr string, data []byte, flags int, context *fuse.Context) fuse.Status
SetXAttr fuse implemention
func (*CfcryptFS) Symlink ¶
func (fs *CfcryptFS) Symlink(pointedTo string, linkName string, context *fuse.Context) (code fuse.Status)
Symlink fuse implemention
type FsConfig ¶
type FsConfig struct { // CipherDir - encrypted directory path CipherDir string // CipherType - corecrypter type, do not set when using your own corecrypter CryptType int // CryptKey - master key for content and name encryption CryptKey []byte // PlainBS - plaintext block size // Should be adjusted according to average size of files. // Also must be suitable for corecrypter PlainBS int // BakingFileMode - mode of the underling file in the cipher directory. (default: 0600) BackingFileMode uint32 // AllowOther - allow other user to access the filesystem, must run as root user AllowOther bool // PlainPath - filepath stay plaintext (not encrypted) PlainPath bool }
FsConfig contains configs for fuse filesystem
Click to show internal directories.
Click to hide internal directories.