secretsfs

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TEMPLATESPATHS map[string]string

Functions

func FIOMaps added in v1.0.0

func FIOMaps() map[string]*FIOMap

FIOMaps returns all registered FIO Plugins mapped with their mountpaths. Generally used by rootnode so it can correctly redirect calls to corresponding plugins.

func FIOMapsEnabled added in v1.0.0

func FIOMapsEnabled() map[string]*FIOMap

FIOMapsEnabled returns a map[string]*FIOMap only with enabled FIOMaps

func GetInode added in v1.0.0

func GetInode(npath string) uint64

GetInode returns a valid inode for npath. If it isn't registered yet, it will be registered

func GetInodeIfRegistered added in v1.0.0

func GetInodeIfRegistered(npath string) (uint64, bool)

GetInodeIfRegistered returns the inode if it is registered, won't register it if it isn't already registered

func GetMapStringKeys added in v1.0.0

func GetMapStringKeys(m map[string]interface{}) []string

GetMapStringKeys returns []string containing all keys from a map[string]interface{}

func IsRootPath added in v1.0.0

func IsRootPath(rootpath string) bool

IsRootPath checks whether the given rootpath is registered and enabled in fiomaps

func PrettyPrint added in v1.0.0

func PrettyPrint(v interface{}) ([]byte, error)

PrettyPrint variable (struct, map, array, slice) in Golang https://siongui.github.io/2016/01/30/go-pretty-print-variable/

func RegisterRoot added in v1.0.0

func RegisterRoot(fm *FIOMap)

RegisterRoot registers FIOMaps. To be used inside of init() function of plugins. If FIO is enabled due to configuration, also enable it. If not, only register in in Disabled state.

func RootPathsEnabled added in v1.0.0

func RootPathsEnabled() []string

RootPathsEnabled returns all registered fioRootPaths that are enabled

Types

type FIOInternal added in v1.0.0

type FIOInternal struct{}

func (*FIOInternal) FIOPath added in v1.0.0

func (sf *FIOInternal) FIOPath() string

FIOPath returns name of implemented FIO Plugin sf := Secretsfs Fio

func (*FIOInternal) Getattr added in v1.0.0

func (sf *FIOInternal) Getattr(n *SfsNode, ctx context.Context, fh fs.FileHandle, out *fuse.AttrOut) syscall.Errno

func (*FIOInternal) Lookup added in v1.0.0

func (sf *FIOInternal) Lookup(n *SfsNode, ctx context.Context, name string, out *fuse.EntryOut) (node *fs.Inode, errno syscall.Errno)

Lookuper

func (*FIOInternal) Open added in v1.0.0

func (sf *FIOInternal) Open(n *SfsNode, ctx context.Context, flags uint32) (fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)

Opener

func (*FIOInternal) Read added in v1.0.0

func (sf *FIOInternal) Read(n *SfsNode, ctx context.Context, f fs.FileHandle, dest []byte, off int64) (fuse.ReadResult, syscall.Errno)

Reader

func (*FIOInternal) Readdir added in v1.0.0

func (sf *FIOInternal) Readdir(n *SfsNode, ctx context.Context) (out fs.DirStream, errno syscall.Errno)

Readdirer

type FIOMap added in v1.0.0

type FIOMap struct {
	Root    FIORoot
	Enabled bool
}

FIOMap maps the FIORoot Node to a Mountpath Used for registering FIORoots to the secretsfs rootnode

type FIORoot added in v1.0.0

type FIORoot interface {
	// Node Operations
	Readdir(n *SfsNode, ctx context.Context) (out fs.DirStream, errno syscall.Errno)
	Lookup(n *SfsNode, ctx context.Context, name string, out *fuse.EntryOut) (node *fs.Inode, errno syscall.Errno)
	Open(n *SfsNode, ctx context.Context, flags uint32) (fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)
	Read(n *SfsNode, ctx context.Context, f fs.FileHandle, dest []byte, off int64) (fuse.ReadResult, syscall.Errno)
	Getattr(n *SfsNode, ctx context.Context, fh fs.FileHandle, out *fuse.AttrOut) syscall.Errno

	// FIOPath() is used for registering and finding FIOMaps
	FIOPath() string
}

FIORoot interface describes functions a new FIO plugin should implement.

type FIOSecretsFiles added in v1.0.0

type FIOSecretsFiles struct{}

func (*FIOSecretsFiles) FIOPath added in v1.0.0

func (sf *FIOSecretsFiles) FIOPath() string

func (*FIOSecretsFiles) Getattr added in v1.0.0

func (sf *FIOSecretsFiles) Getattr(n *SfsNode, ctx context.Context, fh fs.FileHandle, out *fuse.AttrOut) syscall.Errno

func (*FIOSecretsFiles) Lookup added in v1.0.0

func (sf *FIOSecretsFiles) Lookup(n *SfsNode, ctx context.Context, name string, out *fuse.EntryOut) (node *fs.Inode, errno syscall.Errno)

func (*FIOSecretsFiles) Open added in v1.0.0

func (sf *FIOSecretsFiles) Open(n *SfsNode, ctx context.Context, flags uint32) (fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)

func (*FIOSecretsFiles) Read added in v1.0.0

func (sf *FIOSecretsFiles) Read(n *SfsNode, ctx context.Context, f fs.FileHandle, dest []byte, off int64) (fuse.ReadResult, syscall.Errno)

func (*FIOSecretsFiles) Readdir added in v1.0.0

func (sf *FIOSecretsFiles) Readdir(n *SfsNode, ctx context.Context) (out fs.DirStream, errno syscall.Errno)

type FIOTemplateFiles added in v1.0.0

type FIOTemplateFiles struct{}

func (*FIOTemplateFiles) FIOPath added in v1.0.0

func (sf *FIOTemplateFiles) FIOPath() string

func (*FIOTemplateFiles) Getattr added in v1.0.0

func (sf *FIOTemplateFiles) Getattr(n *SfsNode, ctx context.Context, fh fs.FileHandle, out *fuse.AttrOut) syscall.Errno

func (*FIOTemplateFiles) Lookup added in v1.0.0

func (sf *FIOTemplateFiles) Lookup(n *SfsNode, ctx context.Context, name string, out *fuse.EntryOut) (node *fs.Inode, errno syscall.Errno)

func (*FIOTemplateFiles) Open added in v1.0.0

func (sf *FIOTemplateFiles) Open(n *SfsNode, ctx context.Context, flags uint32) (fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)

func (*FIOTemplateFiles) Read added in v1.0.0

func (sf *FIOTemplateFiles) Read(n *SfsNode, ctx context.Context, f fs.FileHandle, dest []byte, off int64) (fuse.ReadResult, syscall.Errno)

func (*FIOTemplateFiles) Readdir added in v1.0.0

func (sf *FIOTemplateFiles) Readdir(n *SfsNode, ctx context.Context) (out fs.DirStream, errno syscall.Errno)

type FIOTest added in v1.0.0

type FIOTest struct{}

func (*FIOTest) FIOPath added in v1.0.0

func (sf *FIOTest) FIOPath() string

FIOPath returns name of implemented FIO Plugin sf := Secretsfs Fio

func (*FIOTest) Getattr added in v1.0.0

func (sf *FIOTest) Getattr(n *SfsNode, ctx context.Context, fh fs.FileHandle, out *fuse.AttrOut) syscall.Errno

func (*FIOTest) Lookup added in v1.0.0

func (sf *FIOTest) Lookup(n *SfsNode, ctx context.Context, name string, out *fuse.EntryOut) (node *fs.Inode, errno syscall.Errno)

Lookuper

func (*FIOTest) Open added in v1.0.0

func (sf *FIOTest) Open(n *SfsNode, ctx context.Context, flags uint32) (fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)

Opener

func (*FIOTest) Read added in v1.0.0

func (sf *FIOTest) Read(n *SfsNode, ctx context.Context, f fs.FileHandle, dest []byte, off int64) (fuse.ReadResult, syscall.Errno)

Reader

func (*FIOTest) Readdir added in v1.0.0

func (sf *FIOTest) Readdir(n *SfsNode, ctx context.Context) (out fs.DirStream, errno syscall.Errno)

Readdirer

type SfsNode added in v1.0.0

type SfsNode struct {
	fs.Inode
	// contains filtered or unexported fields
}

func GetNewRootNode added in v1.0.0

func GetNewRootNode(npath string, fms map[string]*FIOMap) *SfsNode

func NewNode added in v1.0.0

func NewNode(npath string) *SfsNode

func (*SfsNode) Getattr added in v1.0.0

func (n *SfsNode) Getattr(ctx context.Context, fh fs.FileHandle, out *fuse.AttrOut) syscall.Errno

func (*SfsNode) Lookup added in v1.0.0

func (n *SfsNode) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)

func (*SfsNode) NPath added in v1.0.0

func (n *SfsNode) NPath() string

func (*SfsNode) OnAdd added in v1.0.0

func (n *SfsNode) OnAdd(ctx context.Context)

func (*SfsNode) Open added in v1.0.0

func (n *SfsNode) Open(ctx context.Context, flags uint32) (fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)

func (*SfsNode) Read added in v1.0.0

func (n *SfsNode) Read(ctx context.Context, fh fs.FileHandle, dest []byte, off int64) (fuse.ReadResult, syscall.Errno)

func (*SfsNode) Readdir added in v1.0.0

func (n *SfsNode) Readdir(ctx context.Context) (fs.DirStream, syscall.Errno)

Jump to

Keyboard shortcuts

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