helpers

package
v0.0.0-...-936f88a Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCachingHandler

func NewCachingHandler(h nfs.Handler, limit int) nfs.Handler

NewCachingHandler wraps a handler to provide a basic to/from-file handle cache.

func NewNullAuthHandler

func NewNullAuthHandler(fs billy.Filesystem) nfs.Handler

NewNullAuthHandler creates a handler for the provided filesystem

Types

type CachingHandler

type CachingHandler struct {
	nfs.Handler
	// contains filtered or unexported fields
}

CachingHandler implements to/from handle via an LRU cache.

func (*CachingHandler) FromHandle

func (c *CachingHandler) FromHandle(fh []byte) (billy.Filesystem, []string, error)

FromHandle converts from an opaque handle to the file it represents

func (*CachingHandler) HandleLimit

func (c *CachingHandler) HandleLimit() int

HandleLimit exports how many file handles can be safely stored by this cache.

func (*CachingHandler) ToHandle

func (c *CachingHandler) ToHandle(f billy.Filesystem, path []string) []byte

ToHandle takes a file and represents it with an opaque handle to reference it. In stateless nfs (when it's serving a unix fs) this can be the device + inode but we can generalize with a stateful local cache of handed out IDs.

type NullAuthHandler

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

NullAuthHandler returns a NFS backing that exposes a given file system in response to all mount requests.

func (*NullAuthHandler) Change

func (h *NullAuthHandler) Change(fs billy.Filesystem) billy.Change

Change provides an interface for updating file attributes.

func (*NullAuthHandler) FSStat

func (h *NullAuthHandler) FSStat(ctx context.Context, f billy.Filesystem, s *nfs.FSStat) error

FSStat provides information about a filesystem.

func (*NullAuthHandler) FromHandle

func (h *NullAuthHandler) FromHandle([]byte) (billy.Filesystem, []string, error)

FromHandle handled by CachingHandler

func (*NullAuthHandler) HandleLimit

func (h *NullAuthHandler) HandleLimit() int

HandleLImit handled by cachingHandler

func (*NullAuthHandler) Mount

func (h *NullAuthHandler) Mount(ctx context.Context, conn net.Conn, req nfs.MountRequest) (status nfs.MountStatus, hndl billy.Filesystem, auths []nfs.AuthFlavor)

Mount backs Mount RPC Requests, allowing for access control policies.

func (*NullAuthHandler) ToHandle

func (h *NullAuthHandler) ToHandle(f billy.Filesystem, s []string) []byte

ToHandle handled by CachingHandler

Jump to

Keyboard shortcuts

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