memboxfs

package
v0.0.75 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package memboxfs provides a billy.Fs-compatible filesystem implementation which limits the maxiumum size of the in-memory filesystem.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = fmt.Errorf("not implemented")

ErrNotImplemented is returned when a method is not implemented.

View Source
var ErrTooBig = fmt.Errorf("file too big")

ErrTooBig is returned when a file is too big.

View Source
var ErrTooManyFiles = fmt.Errorf("too many files")

ErrTooManyFiles is returned when there are too many files.

Functions

This section is empty.

Types

type LimitedFs

type LimitedFs struct {
	Fs            billy.Filesystem
	MaxFiles      int64
	TotalFileSize int64
	// contains filtered or unexported fields
}

LimitedFs provides a size-limited billy.Filesystem. This is a struct, there's no constructor here. Note that LimitedFs is not thread-safe.

func (*LimitedFs) Chroot

func (_ *LimitedFs) Chroot(_ string) (billy.Filesystem, error)

Chroot implements billy.Filesystem.

func (*LimitedFs) Create

func (f *LimitedFs) Create(filename string) (billy.File, error)

Create implements billy.Filesystem.

func (*LimitedFs) Join

func (f *LimitedFs) Join(elem ...string) string

Join implements billy.Filesystem.

func (*LimitedFs) Lstat

func (f *LimitedFs) Lstat(filename string) (fs.FileInfo, error)

Lstat implements billy.Filesystem.

func (*LimitedFs) MkdirAll

func (f *LimitedFs) MkdirAll(filename string, perm fs.FileMode) error

MkdirAll implements billy.Filesystem.

func (*LimitedFs) Open

func (f *LimitedFs) Open(filename string) (billy.File, error)

Open implements billy.Filesystem.

func (*LimitedFs) OpenFile

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

OpenFile implements billy.Filesystem.

func (*LimitedFs) ReadDir

func (f *LimitedFs) ReadDir(path string) ([]fs.FileInfo, error)

ReadDir implements billy.Filesystem.

func (f *LimitedFs) Readlink(link string) (string, error)

Readlink implements billy.Filesystem.

func (*LimitedFs) Remove

func (f *LimitedFs) Remove(filename string) error

Remove implements billy.Filesystem.

func (*LimitedFs) Rename

func (f *LimitedFs) Rename(oldpath string, newpath string) error

Rename implements billy.Filesystem.

func (*LimitedFs) Root

func (f *LimitedFs) Root() string

Root implements billy.Filesystem.

func (*LimitedFs) Stat

func (f *LimitedFs) Stat(filename string) (fs.FileInfo, error)

Stat implements billy.Filesystem.

func (f *LimitedFs) Symlink(target string, link string) error

Symlink implements billy.Filesystem.

func (*LimitedFs) TempFile

func (f *LimitedFs) TempFile(dir string, prefix string) (billy.File, error)

TempFile implements billy.Filesystem.

Jump to

Keyboard shortcuts

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