fs

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2016 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Root

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

Root implements both Node and Handle

func NewRoot

func NewRoot(root string, logic *api.Logical) *Root

NewRoot creates a new root and returns it

func (Root) Attr

func (Root) Attr(ctx context.Context, a *fuse.Attr) error

Attr sets attrs on the given fuse.Attr

func (*Root) Lookup

func (r *Root) Lookup(ctx context.Context, name string) (fs.Node, error)

Lookup looks up a path

func (*Root) ReadDirAll

func (r *Root) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error)

ReadDirAll returns a list of secrets

type Secret

type Secret struct {
	*api.Secret
	// contains filtered or unexported fields
}

Secret represents secrets which directly contain data (cannot be treated as directories in the vault backend). They are still treated as directories in FUSE because we want to expose data/ as files.

func NewSecret

func NewSecret(logic *api.Logical, backend *api.Secret, lookupPath string) (*Secret, error)

NewSecret creates a node which represents a directory and provides access to the subkeys of a secret.

func (Secret) Attr

func (s Secret) Attr(ctx context.Context, a *fuse.Attr) error

Attr returns attributes about this Secret

func (*Secret) Lookup

func (s *Secret) Lookup(ctx context.Context, name string) (fs.Node, error)

Lookup looks up a path

func (*Secret) ReadDirAll

func (s *Secret) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error)

ReadDirAll returns a list of the subkey-files available for a secret

type SecretDir

type SecretDir struct {
	*api.Secret
	// contains filtered or unexported fields
}

SecretDir implements Node and Handle This is the type we return if the Secret is a secret that we only were able to get via a list - i.e. is directory-like.

func NewSecretDir

func NewSecretDir(logic *api.Logical, backend *api.Secret, lookupPath string) (*SecretDir, error)

NewSecretDir creates a SecretDir node linked to the given secret and vault API.

func (SecretDir) Attr

func (s SecretDir) Attr(ctx context.Context, a *fuse.Attr) error

Attr returns attributes about this Secret

func (*SecretDir) Lookup

func (s *SecretDir) Lookup(ctx context.Context, name string) (fs.Node, error)

Lookup looks up a path

func (*SecretDir) ReadDirAll

func (s *SecretDir) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error)

ReadDirAll returns a list of secrets in this directory

type StaticDir

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

StaticDir implements a fuse directory structure with static content.

func NewStaticDir

func NewStaticDir(values map[string]interface{}) (*StaticDir, error)

NewStaticDir generates a new static directory tree of arbitrary depth from the supplied map.

func (*StaticDir) Attr

func (s *StaticDir) Attr(ctx context.Context, a *fuse.Attr) error

Attr sets attrs on the given fuse.Attr

func (*StaticDir) Lookup

func (s *StaticDir) Lookup(ctx context.Context, name string) (fs.Node, error)

Lookup looks up a path

func (*StaticDir) ReadDirAll

func (s *StaticDir) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error)

ReadDirAll enumerates the static content as files if a StaticValue or direcotries if another StaticDir.

type StaticValue

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

StaticValue implements a node which always serves the same bytes.

func NewValue

func NewValue(value string) (*StaticValue, error)

NewValue returns a new Value node (a file with static content)

func (*StaticValue) Attr

func (f *StaticValue) Attr(ctx context.Context, a *fuse.Attr) error

Attr sets attrs on the given fuse.Attr

func (*StaticValue) Read

func (f *StaticValue) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error

Read simply returns the statically stored content of the node.

type VaultFS

type VaultFS struct {
	*api.Client
	// contains filtered or unexported fields
}

VaultFS is a vault filesystem

func New

func New(config *api.Config, mountpoint string, root string, token string) (*VaultFS, error)

New returns a new VaultFS

func (*VaultFS) Mount

func (v *VaultFS) Mount() error

Mount the FS at the given mountpoint

func (*VaultFS) Root

func (v *VaultFS) Root() (fs.Node, error)

Root returns the struct that does the actual work

func (*VaultFS) Unmount

func (v *VaultFS) Unmount() error

Unmount the FS

Jump to

Keyboard shortcuts

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