helpers

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2024 License: Apache-2.0 Imports: 10 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 NewCachingHandlerWithVerifierLimit

func NewCachingHandlerWithVerifierLimit(h nfs.Handler, limit int, verifierLimit int) nfs.Handler

NewCachingHandlerWithVerifierLimit provides a basic to/from-file handle cache that can be tuned with a smaller cache of active directory listings.

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) DataForVerifier

func (c *CachingHandler) DataForVerifier(path string, id uint64) []fs.FileInfo

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) InvalidateHandle

func (c *CachingHandler) InvalidateHandle(fs billy.Filesystem, handle []byte) error

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.

func (*CachingHandler) VerifierFor

func (c *CachingHandler) VerifierFor(path string, contents []fs.FileInfo) uint64

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) InvalidateHandle

func (c *NullAuthHandler) InvalidateHandle(billy.Filesystem, []byte) error

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

Directories

Path Synopsis
Package memfs is a variant of "github.com/go-git/go-billy/v5/memfs" with stable mtimes for items.
Package memfs is a variant of "github.com/go-git/go-billy/v5/memfs" with stable mtimes for items.

Jump to

Keyboard shortcuts

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