fs

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Disk

type Disk struct{}

Disk represents disk based file system

func NewDisk

func NewDisk() *Disk

NewDisk instantiates new disk based file system

func (*Disk) Open

func (fs *Disk) Open(path string) (cask.File, error)

Open opens a default data file for reading and creates it if it does not exist

func (*Disk) ReadFileAt

func (fs *Disk) ReadFileAt(path string, file string, b []byte, o int64) (int, error)

func (*Disk) Rotate

func (fs *Disk) Rotate(path string) (cask.File, error)

Rotate creates a new active data file and opens it

func (*Disk) Walk

func (fs *Disk) Walk(path string, wf func(cask.File) error) error

type DiskFile

type DiskFile struct {
	*os.File
	// contains filtered or unexported fields
}

DiskFile represents file on disk

func (*DiskFile) Name

func (f *DiskFile) Name() string

Name returns the base name of the file (without path and/or extension)

func (*DiskFile) Size

func (f *DiskFile) Size() int64

Size returns current data file size in kb

func (*DiskFile) Write

func (f *DiskFile) Write(p []byte) (int, error)

Write delegates writing to the underlying file and increments file size

type InMemory

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

func NewInMemory

func NewInMemory() *InMemory

func (*InMemory) Open

func (i *InMemory) Open(_ string) (cask.File, error)

func (*InMemory) ReadFileAt

func (i *InMemory) ReadFileAt(_ string, _ string, b []byte, offset int64) (int, error)

func (*InMemory) Rotate

func (i *InMemory) Rotate(_ string) (cask.File, error)

func (*InMemory) Walk

func (i *InMemory) Walk(_ string, f func(cask.File) error) error

type InMemoryFile

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

func (*InMemoryFile) Close

func (i *InMemoryFile) Close() error

func (*InMemoryFile) Name

func (i *InMemoryFile) Name() string

func (*InMemoryFile) Read

func (i *InMemoryFile) Read(p []byte) (n int, err error)

func (*InMemoryFile) Size

func (i *InMemoryFile) Size() int64

func (*InMemoryFile) Write

func (i *InMemoryFile) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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