nfs

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultHandleCacheSize = 1000000

Variables

View Source
var DefaultOptions = &Options{
	HandleCacheSize: DefaultHandleCacheSize,
}

Functions

func LoggingFS

func LoggingFS(ctx context.Context, next billy.Filesystem, log *slog.Logger) billy.Filesystem

func NewHandler

func NewHandler(ctx context.Context, tree index.Tree, opts *Options) nfs.Handler

func NewZipFS

func NewZipFS(tree index.Tree) billy.Filesystem

func Serve

func Serve(ctx context.Context, listener net.Listener, handler nfs.Handler) error

Types

type Options

type Options struct {
	HandleCacheSize int
	Logger          *slog.Logger
}

type ZipFS

type ZipFS struct {
	Tree index.Tree
}

func (*ZipFS) Capabilities

func (fs *ZipFS) Capabilities() billy.Capability

Capabilities exports the filesystem as readonly

func (*ZipFS) Chroot

func (fs *ZipFS) Chroot(path string) (billy.Filesystem, error)

func (*ZipFS) Create

func (fs *ZipFS) Create(filename string) (billy.File, error)

func (*ZipFS) Join

func (fs *ZipFS) Join(elem ...string) string

func (*ZipFS) Lstat

func (fs *ZipFS) Lstat(filename string) (os.FileInfo, error)

func (*ZipFS) MkdirAll

func (fs *ZipFS) MkdirAll(filename string, perm os.FileMode) error

func (*ZipFS) Open

func (fs *ZipFS) Open(filename string) (billy.File, error)

func (*ZipFS) OpenFile

func (fs *ZipFS) OpenFile(filename string, flag int, perm os.FileMode) (billy.File, error)

func (*ZipFS) ReadDir

func (fs *ZipFS) ReadDir(name string) ([]os.FileInfo, error)
func (fs *ZipFS) Readlink(link string) (string, error)

func (*ZipFS) Remove

func (fs *ZipFS) Remove(filename string) error

func (*ZipFS) Rename

func (fs *ZipFS) Rename(oldpath, newpath string) error

func (*ZipFS) Root

func (fs *ZipFS) Root() string

func (*ZipFS) Stat

func (fs *ZipFS) Stat(filename string) (os.FileInfo, error)
func (fs *ZipFS) Symlink(target, link string) error

func (*ZipFS) TempFile

func (fs *ZipFS) TempFile(dir, prefix string) (billy.File, error)

Jump to

Keyboard shortcuts

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