hookfs

package
v1.8.6 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InjectPath  = "/inject"
	RecoverPath = "/recover"
)

Functions

This section is empty.

Types

type ChaosBladeHookClient

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

func NewChabladeHookClient

func NewChabladeHookClient(addr string) *ChaosBladeHookClient

func (*ChaosBladeHookClient) InjectFault

func (c *ChaosBladeHookClient) InjectFault(ctx context.Context, injectMsg *InjectMessage) error

func (*ChaosBladeHookClient) Revoke

func (c *ChaosBladeHookClient) Revoke(ctx context.Context) error

type ChaosbladeHook

type ChaosbladeHook struct {
	MountPoint string
}

func (*ChaosbladeHook) PostAccess

func (h *ChaosbladeHook) PostAccess(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)

func (*ChaosbladeHook) PostAllocate

func (h *ChaosbladeHook) PostAllocate(realRetCode int32, prehookCtx hookfs.HookContext) (hooked bool, err error)

func (*ChaosbladeHook) PostChmod

func (h *ChaosbladeHook) PostChmod(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)

func (*ChaosbladeHook) PostChown

func (h *ChaosbladeHook) PostChown(realRetCode int32, prehookCtx hookfs.HookContext) (hooked bool, err error)

func (*ChaosbladeHook) PostCreate

func (h *ChaosbladeHook) PostCreate(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)

func (*ChaosbladeHook) PostFlush

func (h *ChaosbladeHook) PostFlush(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)

func (*ChaosbladeHook) PostFsync

func (h *ChaosbladeHook) PostFsync(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)

func (*ChaosbladeHook) PostGetAttr

func (h *ChaosbladeHook) PostGetAttr(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)

func (*ChaosbladeHook) PostGetLk

func (h *ChaosbladeHook) PostGetLk(realRetCode int32, prehookCtx hookfs.HookContext) (hooked bool, err error)

func (*ChaosbladeHook) PostGetXAttr

func (h *ChaosbladeHook) PostGetXAttr(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)
func (h *ChaosbladeHook) PostLink(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)

func (*ChaosbladeHook) PostListXAttr

func (h *ChaosbladeHook) PostListXAttr(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)

func (*ChaosbladeHook) PostMkdir

func (h *ChaosbladeHook) PostMkdir(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)

func (*ChaosbladeHook) PostMknod

func (h *ChaosbladeHook) PostMknod(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)

func (*ChaosbladeHook) PostOpen

func (h *ChaosbladeHook) PostOpen(int32, hookfs.HookContext) (bool, error)

func (*ChaosbladeHook) PostOpenDir

func (h *ChaosbladeHook) PostOpenDir(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)

func (*ChaosbladeHook) PostRead

func (h *ChaosbladeHook) PostRead(realRetCode int32, realBuf []byte, prehookCtx hookfs.HookContext) ([]byte, bool, error)
func (h *ChaosbladeHook) PostReadlink(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)

func (*ChaosbladeHook) PostRelease

func (h *ChaosbladeHook) PostRelease(prehookCtx hookfs.HookContext) (hooked bool)

func (*ChaosbladeHook) PostRemoveXAttr

func (h *ChaosbladeHook) PostRemoveXAttr(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)

func (*ChaosbladeHook) PostRename

func (h *ChaosbladeHook) PostRename(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)

func (*ChaosbladeHook) PostRmdir

func (h *ChaosbladeHook) PostRmdir(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)

func (*ChaosbladeHook) PostSetLk

func (h *ChaosbladeHook) PostSetLk(realRetCode int32, prehookCtx hookfs.HookContext) (hooked bool, err error)

func (*ChaosbladeHook) PostSetLkw

func (h *ChaosbladeHook) PostSetLkw(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)

func (*ChaosbladeHook) PostSetXAttr

func (h *ChaosbladeHook) PostSetXAttr(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)

func (*ChaosbladeHook) PostStatFs

func (h *ChaosbladeHook) PostStatFs(prehookCtx hookfs.HookContext) (bool, error)
func (h *ChaosbladeHook) PostSymlink(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)

func (*ChaosbladeHook) PostTruncate

func (h *ChaosbladeHook) PostTruncate(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)
func (h *ChaosbladeHook) PostUnlink(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)

func (*ChaosbladeHook) PostUtimens

func (h *ChaosbladeHook) PostUtimens(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)

func (*ChaosbladeHook) PostWrite

func (h *ChaosbladeHook) PostWrite(realRetCode int32, prehookCtx hookfs.HookContext) (bool, error)

func (*ChaosbladeHook) PreAccess

func (h *ChaosbladeHook) PreAccess(name string, mode uint32) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreAllocate

func (h *ChaosbladeHook) PreAllocate(path string, off uint64, size uint64, mode uint32) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreChmod

func (h *ChaosbladeHook) PreChmod(path string, perms uint32) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreChown

func (h *ChaosbladeHook) PreChown(path string, uid uint32, gid uint32) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreCreate

func (h *ChaosbladeHook) PreCreate(name string, flags uint32, mode uint32) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreFlush

func (h *ChaosbladeHook) PreFlush(path string) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreFsync

func (h *ChaosbladeHook) PreFsync(path string, flags uint32) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreGetAttr

func (h *ChaosbladeHook) PreGetAttr(path string) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreGetLk

func (h *ChaosbladeHook) PreGetLk(path string, owner uint64, lk *fuse.FileLock, flags uint32, out *fuse.FileLock) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreGetXAttr

func (h *ChaosbladeHook) PreGetXAttr(name string, attribute string) (bool, hookfs.HookContext, error)
func (h *ChaosbladeHook) PreLink(oldName string, newName string) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreListXAttr

func (h *ChaosbladeHook) PreListXAttr(name string) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreMkdir

func (h *ChaosbladeHook) PreMkdir(path string, mode uint32) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreMknod

func (h *ChaosbladeHook) PreMknod(name string, mode uint32, dev uint32) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreOpen

func (h *ChaosbladeHook) PreOpen(path string, flags uint32) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreOpenDir

func (h *ChaosbladeHook) PreOpenDir(path string) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreRead

func (h *ChaosbladeHook) PreRead(path string, length int64, offset int64) ([]byte, bool, hookfs.HookContext, error)
func (h *ChaosbladeHook) PreReadlink(name string) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreRelease

func (h *ChaosbladeHook) PreRelease(path string) (bool, hookfs.HookContext)

func (*ChaosbladeHook) PreRemoveXAttr

func (h *ChaosbladeHook) PreRemoveXAttr(name string, attr string) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreRename

func (h *ChaosbladeHook) PreRename(oldName string, newName string) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreRmdir

func (h *ChaosbladeHook) PreRmdir(path string) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreSetLk

func (h *ChaosbladeHook) PreSetLk(path string, owner uint64, lk *fuse.FileLock, flags uint32) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreSetLkw

func (h *ChaosbladeHook) PreSetLkw(path string, owner uint64, lk *fuse.FileLock, flags uint32) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreSetXAttr

func (h *ChaosbladeHook) PreSetXAttr(name string, attr string, data []byte, flags int) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreStatFs

func (h *ChaosbladeHook) PreStatFs(path string) (bool, hookfs.HookContext, error)
func (h *ChaosbladeHook) PreSymlink(value string, linkName string) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreTruncate

func (h *ChaosbladeHook) PreTruncate(path string, size uint64) (bool, hookfs.HookContext, error)
func (h *ChaosbladeHook) PreUnlink(name string) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreUtimens

func (h *ChaosbladeHook) PreUtimens(path string, atime *time.Time, mtime *time.Time) (bool, hookfs.HookContext, error)

func (*ChaosbladeHook) PreWrite

func (h *ChaosbladeHook) PreWrite(path string, buf []byte, offset int64) (bool, hookfs.HookContext, error)

type ChaosbladeHookContext

type ChaosbladeHookContext struct {
}

type ChaosbladeHookServer

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

func NewChaosbladeHookServer

func NewChaosbladeHookServer(addr string) *ChaosbladeHookServer

func (*ChaosbladeHookServer) InjectHandler

func (s *ChaosbladeHookServer) InjectHandler(w http.ResponseWriter, r *http.Request)

func (*ChaosbladeHookServer) RecoverHandler

func (s *ChaosbladeHookServer) RecoverHandler(w http.ResponseWriter, r *http.Request)

func (*ChaosbladeHookServer) Start

func (s *ChaosbladeHookServer) Start(stop <-chan struct{}) error

type InjectMessage

type InjectMessage struct {
	Methods []string `json:"methods"`
	Path    string   `json:"path"`
	Delay   uint32   `json:"delay"`
	Percent uint32   `json:"percent"`
	Random  bool     `json:"random"`
	Errno   uint32   `json:"errno"`
}

Jump to

Keyboard shortcuts

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