Documentation
¶
Index ¶
- func NewKvHandler(h nfs.Handler, fs nfs.Filesystem, config config.NFS) (nfs.Handler, error)
- func NewNFSv3Handler(fs vfs.Filesystem, config config.NFS) (nfs.Handler, error)
- type CachingHandler
- func (c *CachingHandler) ActiveHandlers() int
- func (c *CachingHandler) FromHandle(ctx context.Context, fh []byte) (nfs.Filesystem, []string, error)
- func (c *CachingHandler) HandleLimit() int
- func (c *CachingHandler) InvalidateHandle(ctx context.Context, fs nfs.Filesystem, handle []byte) error
- func (c *CachingHandler) ToHandle(ctx context.Context, _ nfs.Filesystem, path []string) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewKvHandler ¶
NewKvHandler provides a basic to/from-file handle cache that can be tuned with a smaller cache of active directory listings.
func NewNFSv3Handler ¶
Types ¶
type CachingHandler ¶
CachingHandler implements to/from handle via an LRU cache.
func (*CachingHandler) ActiveHandlers ¶
func (c *CachingHandler) ActiveHandlers() int
HandleLimit exports how many file handles can be safely stored by this cache.
func (*CachingHandler) FromHandle ¶
func (c *CachingHandler) FromHandle(ctx context.Context, fh []byte) (nfs.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(ctx context.Context, fs nfs.Filesystem, handle []byte) error
func (*CachingHandler) ToHandle ¶
func (c *CachingHandler) ToHandle(ctx context.Context, _ nfs.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.
Click to show internal directories.
Click to hide internal directories.