Documentation ¶
Index ¶
Constants ¶
View Source
const ( TypeFile = 1 // type for regular file TypeDirectory = 2 // type for directory )
View Source
const ( // SetAttrMode is a mask to update a attribute of node SetAttrMode = 1 << iota SetAttrUID SetAttrGID SetAttrSize SetAttrAtime SetAttrMtime SetAttrCtime SetAttrAtimeNow SetAttrMtimeNow )
View Source
const MaxName = 255
View Source
const SkipDirMtime time.Duration = 100 * time.Millisecond
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attr ¶
type Attr struct { Typ uint8 // type of a node Mode uint16 // permission mode Rdev uint32 // device number Atime int64 // last access time Mtime int64 // last modified time Ctime int64 // last change time for meta Atimensec uint32 // nanosecond part of atime Mtimensec uint32 // nanosecond part of mtime Ctimensec uint32 // nanosecond part of ctime Nlink uint32 // number of links (sub-directories or hardlinks) Length uint64 // length of regular file Parent Ino // inode of parent; 0 means tracked by parentKey (for hardlinks) Full bool // the attributes are completed or not }
Attr represents attributes of a node.
type Format ¶
type Meta ¶
type Meta interface { // Name of database Name() string // Init is used to initialize a meta service. Init(format *Format) error // Shutdown close current database connections. Shutdown() Load() (*Format, error) GetNextInode(ctx context.Context, lastIno *Ino) error GetUserId(username string, uid *uint32) error GetUserPublicKey(username string, pubKey *[]byte) error // Lookup returns the inode and attributes for the given entry in a directory. Lookup(ctx context.Context, userId uint32, parent, inode Ino, attr *Attr) syscall.Errno // GetAttr returns the attributes for given node. GetAttr(ctx context.Context, inode Ino, attr *Attr) syscall.Errno // SetAttr updates the attributes for given node. SetAttr(ctx context.Context, inode Ino, in *fuse.SetAttrIn, attr *Attr) syscall.Errno // Unlink removes a file entry from a directory. // The file will be deleted if it's not linked by any entries and not open by any sessions. Unlink(ctx context.Context, parent, inode Ino) syscall.Errno // Rmdir removes an empty sub-directory. Rmdir(ctx context.Context, parent, inode Ino) syscall.Errno // Readdir returns all entries for given directory, which include attributes if plus is true. Readdir(ctx context.Context, inode Ino, userId uint32, entries *[]*Entry) syscall.Errno Mknod(ctx context.Context, parent Ino, _type uint8, mode, id uint32, inode *Ino, name, key []byte, attr *Attr) syscall.Errno // Write put a slice of data on top of the given chunk. Write(ctx context.Context, inode uint64, data []byte, off int64) syscall.Errno GetKey(ctx context.Context, inode Ino, key *[]byte) syscall.Errno CheckUser(username string) error CreateUser(username string, password, salt, rootKey, privKey, pubKey []byte) error VerifyUser(username string, password []byte, rootKey, privKey *[]byte) error GetSalt(username string, salt *[]byte) error ChangePassword(username string, password, salt, rootKey, privKey []byte) error GetPathKey(inode Ino, keys *[][]byte) error }
Meta is a interface for a meta service for file system.
func RegisterMeta ¶
Click to show internal directories.
Click to hide internal directories.