Documentation ¶
Index ¶
- Constants
- func LogLevel() int
- func NotOk(tb testing.TB, err error)
- func Ok(tb testing.TB, err error)
- func SetLogLevel(level log.Level)
- type Hook
- type HookContext
- type HookFs
- func (h *HookFs) Access(name string, mode uint32, context *fuse.Context) fuse.Status
- func (h *HookFs) Chmod(name string, mode uint32, context *fuse.Context) fuse.Status
- func (h *HookFs) Chown(name string, uid uint32, gid uint32, context *fuse.Context) fuse.Status
- func (h *HookFs) Create(name string, flags uint32, mode uint32, context *fuse.Context) (nodefs.File, fuse.Status)
- func (h *HookFs) GetAttr(name string, context *fuse.Context) (*fuse.Attr, fuse.Status)
- func (h *HookFs) GetXAttr(name string, attribute string, context *fuse.Context) ([]byte, fuse.Status)
- func (h *HookFs) Link(oldName string, newName string, context *fuse.Context) fuse.Status
- func (h *HookFs) ListXAttr(name string, context *fuse.Context) ([]string, fuse.Status)
- func (h *HookFs) Mkdir(name string, mode uint32, context *fuse.Context) fuse.Status
- func (h *HookFs) Mknod(name string, mode uint32, dev uint32, context *fuse.Context) fuse.Status
- func (h *HookFs) OnMount(nodeFs *pathfs.PathNodeFs)
- func (h *HookFs) OnUnmount()
- func (h *HookFs) Open(name string, flags uint32, context *fuse.Context) (nodefs.File, fuse.Status)
- func (h *HookFs) OpenDir(name string, context *fuse.Context) ([]fuse.DirEntry, fuse.Status)
- func (h *HookFs) Readlink(name string, context *fuse.Context) (string, fuse.Status)
- func (h *HookFs) RemoveXAttr(name string, attr string, context *fuse.Context) fuse.Status
- func (h *HookFs) Rename(oldName string, newName string, context *fuse.Context) fuse.Status
- func (h *HookFs) Rmdir(name string, context *fuse.Context) fuse.Status
- func (h *HookFs) Serve() error
- func (h *HookFs) ServeAsync() (*fuse.Server, error)
- func (h *HookFs) SetDebug(debug bool)
- func (h *HookFs) SetXAttr(name string, attr string, data []byte, flags int, context *fuse.Context) fuse.Status
- func (h *HookFs) StatFs(name string) *fuse.StatfsOut
- func (h *HookFs) String() string
- func (h *HookFs) Symlink(value string, linkName string, context *fuse.Context) fuse.Status
- func (h *HookFs) Truncate(name string, size uint64, context *fuse.Context) fuse.Status
- func (h *HookFs) Unlink(name string, context *fuse.Context) fuse.Status
- func (h *HookFs) Utimens(name string, Atime *time.Time, Mtime *time.Time, context *fuse.Context) fuse.Status
- type HookOnFsync
- type HookOnMkdir
- type HookOnOpen
- type HookOnOpenDir
- type HookOnRead
- type HookOnRename
- type HookOnRmdir
- type HookOnWrite
- type HookWithInit
Constants ¶
const LogLevelMax = 2
LogLevelMax is the maximum log level
const LogLevelMin = 0
LogLevelMin is the minimum log level
Variables ¶
This section is empty.
Functions ¶
func SetLogLevel ¶
SetLogLevel sets the log level. newLevel must be >= LogLevelMin, and <= LogLevelMax.
Types ¶
type Hook ¶
type Hook interface{}
Hook is the base interface for user-written hooks.
You have to implement HookXXX (e.g. HookOnOpen, HookOnRead, HookOnWrite, ..) interfaces.
type HookContext ¶
type HookContext interface{}
HookContext is the context objects for interaction between prehooks and posthooks.
type HookFs ¶
type HookFs struct { Original string Mountpoint string FsName string // contains filtered or unexported fields }
HookFs is the object hooking the fs.
func (*HookFs) Access ¶
Access implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) Chmod ¶
Chmod implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) Chown ¶
Chown implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) Create ¶
func (h *HookFs) Create(name string, flags uint32, mode uint32, context *fuse.Context) (nodefs.File, fuse.Status)
Create implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) GetAttr ¶
GetAttr implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) GetXAttr ¶
func (h *HookFs) GetXAttr(name string, attribute string, context *fuse.Context) ([]byte, fuse.Status)
GetXAttr implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) Link ¶
Link implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) ListXAttr ¶
ListXAttr implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) Mkdir ¶
Mkdir implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) Mknod ¶
Mknod implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) OnMount ¶
func (h *HookFs) OnMount(nodeFs *pathfs.PathNodeFs)
OnMount implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) OnUnmount ¶
func (h *HookFs) OnUnmount()
OnUnmount implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) Open ¶
Open implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) OpenDir ¶
OpenDir implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) Readlink ¶
Readlink implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) RemoveXAttr ¶
RemoveXAttr implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) Rename ¶
Rename implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) Rmdir ¶
Rmdir implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) ServeAsync ¶
Serve initiates the FUSE loop. Normally, callers should run Serve() and wait for it to exit, but tests will want to run this in a goroutine.
func (*HookFs) SetDebug ¶
SetDebug implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) SetXAttr ¶
func (h *HookFs) SetXAttr(name string, attr string, data []byte, flags int, context *fuse.Context) fuse.Status
SetXAttr implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) StatFs ¶
StatFs implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) String ¶
String implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) Symlink ¶
Symlink implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
func (*HookFs) Truncate ¶
Truncate implements hanwen/go-fuse/fuse/pathfs.FileSystem. You are not expected to call h manually.
type HookOnFsync ¶
type HookOnFsync interface { // if hooked is true, the real fsync() would not be called PreFsync(path string, flags uint32) (hooked bool, ctx HookContext, err error) PostFsync(realRetCode int32, prehookCtx HookContext) (hooked bool, err error) }
HookOnFsync is called on fsync. This also implements Hook.
type HookOnMkdir ¶
type HookOnMkdir interface { // if hooked is true, the real mkdir() would not be called PreMkdir(path string, mode uint32) (hooked bool, ctx HookContext, err error) PostMkdir(realRetCode int32, prehookCtx HookContext) (hooked bool, err error) }
HookOnMkdir is called on mkdir. This also implements Hook.
type HookOnOpen ¶
type HookOnOpen interface { // if hooked is true, the real open() would not be called PreOpen(path string, flags uint32) (hooked bool, ctx HookContext, err error) PostOpen(realRetCode int32, prehookCtx HookContext) (hooked bool, err error) }
HookOnOpen is called on open. This also implements Hook.
type HookOnOpenDir ¶
type HookOnOpenDir interface { // if hooked is true, the real opendir() would not be called PreOpenDir(path string) (hooked bool, ctx HookContext, err error) PostOpenDir(realRetCode int32, prehookCtx HookContext) (hooked bool, err error) }
HookOnOpenDir is called on opendir. This also implements Hook.
type HookOnRead ¶
type HookOnRead interface { // if hooked is true, the real read() would not be called PreRead(path string, length int64, offset int64) (buf []byte, hooked bool, ctx HookContext, err error) PostRead(realRetCode int32, realBuf []byte, prehookCtx HookContext) (buf []byte, hooked bool, err error) }
HookOnRead is called on read. This also implements Hook.
type HookOnRename ¶
type HookOnRename interface { PreRename(oldPatgh string, newPath string) (hooked bool, ctx HookContext, err error) PostRename(oldPatgh string, newPath string) (hooked bool, ctx HookContext, err error) }
HookOnRename is called on rename
type HookOnRmdir ¶
type HookOnRmdir interface { // if hooked is true, the real rmdir() would not be called PreRmdir(path string) (hooked bool, ctx HookContext, err error) PostRmdir(realRetCode int32, prehookCtx HookContext) (hooked bool, err error) }
HookOnRmdir is called on rmdir. This also implements Hook.
type HookOnWrite ¶
type HookOnWrite interface { // if hooked is true, the real write() would not be called PreWrite(path string, buf []byte, offset int64) (hooked bool, ctx HookContext, err error) PostWrite(realRetCode int32, prehookCtx HookContext) (hooked bool, err error) }
HookOnWrite is called on write. This also implements Hook.
type HookWithInit ¶
type HookWithInit interface {
Init() (err error)
}
HookWithInit is called on mount. This also implements Hook.