Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ListFunc ¶
var DefaultList ListFunc = func(proxy *Proxy, path string) ([]fuse.Dirent, fuse.Error) { file, err := os.Open(path) if file == nil { fmt.Fprintf(os.Stderr, "cannot access %s: %v\n", path, err) os.Exit(1) } files, err := file.Readdirnames(-1) if err != nil { log.Fatalf("Could not read dir names %v", path) } dirs := []fuse.Dirent{} for j := 0; j < len(files); j++ { filepath := os_path.Join(path, files[j]) info, err := os.Stat(filepath) if err != nil { return nil, fuse.Errno(syscall.ENOSYS) } var t fuse.DirentType if info.IsDir() { t = fuse.DT_Dir } dirs = append(dirs, fuse.Dirent{ Inode: proxy.inodeForPath(filepath), Name: files[j], Type: t, }) } return dirs, nil }
type LookupFunc ¶
var DefaultLookup LookupFunc = func(p *Proxy, path string, intr fs.Intr) (fs.Node, fuse.Error) { fmt.Println("In default lookup for ", path) info, err := os.Stat(path) if err != nil { return nil, fuse.Errno(syscall.ENOSYS) } if info.IsDir() { return &Directory{ Proxy: p, Path: path, Attributes: dirAttrsForPath(p, path), }, nil } else { return &File{ Proxy: p, Path: path, Attributes: fuse.Attr{ Inode: p.inodeForPath(path), Mode: 0555, }, }, nil } return nil, fuse.Errno(syscall.ENOSYS) }
type Proxy ¶
type Proxy struct { Mountpoint string Source string List ListFunc Lookup LookupFunc ReadAll ReadAllFunc // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.