Documentation ¶
Index ¶
- func NewCachingHandler(h nfs.Handler, limit int) nfs.Handler
- func NewCachingHandlerWithVerifierLimit(h nfs.Handler, limit int, verifierLimit int) nfs.Handler
- func NewNullAuthHandler(fs billy.Filesystem) nfs.Handler
- type CachingHandler
- func (c *CachingHandler) DataForVerifier(path string, id uint64) []fs.FileInfo
- func (c *CachingHandler) FromHandle(fh []byte) (billy.Filesystem, []string, error)
- func (c *CachingHandler) HandleLimit() int
- func (c *CachingHandler) InvalidateHandle(fs billy.Filesystem, handle []byte) error
- func (c *CachingHandler) ToHandle(f billy.Filesystem, path []string) []byte
- func (c *CachingHandler) VerifierFor(path string, contents []fs.FileInfo) uint64
- type NullAuthHandler
- func (h *NullAuthHandler) Change(fs billy.Filesystem) billy.Change
- func (h *NullAuthHandler) FSStat(ctx context.Context, f billy.Filesystem, s *nfs.FSStat) error
- func (h *NullAuthHandler) FromHandle([]byte) (billy.Filesystem, []string, error)
- func (h *NullAuthHandler) HandleLimit() int
- func (c *NullAuthHandler) InvalidateHandle(billy.Filesystem, []byte) error
- func (h *NullAuthHandler) Mount(ctx context.Context, conn net.Conn, req nfs.MountRequest) (status nfs.MountStatus, hndl billy.Filesystem, auths []nfs.AuthFlavor)
- func (h *NullAuthHandler) ToHandle(f billy.Filesystem, s []string) []byte
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 ¶
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