ramstore

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrInvalidTrunc = errRamstore("truncation invalid")
	ErrInvalidPath  = errRamstore("invalid path supplied to Mkdir")
	ErrShortSeek    = errRamstore("attempted negative seek")
	ErrActiveStream = errRamstore("attempted to close a file with active streams")
	ErrDirExists    = errRamstore("directory exists")
	ErrFileClosed   = errRamstore("invalid action on closed file")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Dir added in v0.2.2

type Dir struct {
	// contains filtered or unexported fields
}

This is not great for multiple readers/writers - needs to be reworked Very large structures will cause fairly large allocations due to the recursive maps here

func NewRoot added in v0.2.2

func NewRoot(debug bool) *Dir

func (*Dir) Delete added in v0.2.2

func (d *Dir) Delete(name string) error

func (*Dir) List added in v0.2.2

func (d *Dir) List() []string

func (*Dir) Mkdir added in v0.2.3

func (d *Dir) Mkdir(name string) error

func (*Dir) Open added in v0.2.2

func (d *Dir) Open(name string) (*File, error)

Open works by either returning a file/directory, or recursing if we are still rooted in a path

func (*Dir) Root added in v0.2.2

func (d *Dir) Root(buffer string) (*File, error)

type DirInfo added in v0.2.2

type DirInfo struct {
	// contains filtered or unexported fields
}

func (DirInfo) IsDir added in v0.2.2

func (di DirInfo) IsDir() bool

func (DirInfo) ModTime added in v0.2.2

func (di DirInfo) ModTime() time.Time

func (DirInfo) Mode added in v0.2.2

func (di DirInfo) Mode() os.FileMode

func (DirInfo) Name added in v0.2.2

func (di DirInfo) Name() string

func (DirInfo) Size added in v0.2.2

func (di DirInfo) Size() int64

func (DirInfo) Sys added in v0.2.2

func (di DirInfo) Sys() interface{}

type File

type File struct {
	// contains filtered or unexported fields
}

func (*File) Close

func (f *File) Close() error

func (*File) Name

func (f *File) Name() string

func (*File) Read

func (f *File) Read(b []byte) (n int, err error)

func (*File) Readdir added in v0.2.2

func (f *File) Readdir(n int) ([]fs.FileInfo, error)

func (*File) Seek

func (f *File) Seek(offset int64, whence int) (int64, error)

func (*File) Stat

func (f *File) Stat() (fs.FileInfo, error)

func (*File) Truncate

func (f *File) Truncate(cap int64) error

func (*File) Write

func (f *File) Write(p []byte) (n int, err error)

type FileInfo

type FileInfo struct {
	// contains filtered or unexported fields
}

func (FileInfo) IsDir

func (fi FileInfo) IsDir() bool

func (FileInfo) ModTime

func (fi FileInfo) ModTime() time.Time

func (FileInfo) Mode

func (fi FileInfo) Mode() os.FileMode

func (FileInfo) Name

func (fi FileInfo) Name() string

func (FileInfo) Size

func (fi FileInfo) Size() int64

func (FileInfo) Sys

func (fi FileInfo) Sys() interface{}

Jump to

Keyboard shortcuts

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