fio

package
v0.0.0-...-63846e3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const DataFilePerm = 0644

Variables

This section is empty.

Functions

This section is empty.

Types

type FileIO

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

func NewFileIOManager

func NewFileIOManager(path string) (*FileIO, error)

func (*FileIO) Close

func (fi *FileIO) Close() error

func (*FileIO) Read

func (fi *FileIO) Read(b []byte, offset int64) (int, error)

Read reads data from the file at the specified offset.

func (*FileIO) Size

func (fi *FileIO) Size() (int64, error)

Size get the size of the file

func (*FileIO) Sync

func (fi *FileIO) Sync() error

func (*FileIO) Write

func (fi *FileIO) Write(b []byte) (int, error)

type FileIOType

type FileIOType = byte
const (
	// StandardFIO standard file IO
	StandardFIO FileIOType = iota

	// MemoryMap memory-mapped file IO
	MemoryMap
)

type IOManager

type IOManager interface {

	// Read reads data from the file at the specified offset.
	Read([]byte, int64) (int, error)

	// Write writes data to the file.
	Write([]byte) (int, error)

	// Sync syncs the data to disk.
	Sync() error

	// Close closes the file.
	Close() error

	// Size get the size of the file
	Size() (int64, error)
}

func NewIOManager

func NewIOManager(fileName string, ioType FileIOType) (IOManager, error)

NewIOManager Initializes an IOManager

type MMap

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

MMap (Memory Map a File) IO type

func NewMMapIOManager

func NewMMapIOManager(fileName string) (*MMap, error)

func (*MMap) Close

func (mmap *MMap) Close() error

func (*MMap) Read

func (mmap *MMap) Read(b []byte, offset int64) (int, error)

func (*MMap) Size

func (mmap *MMap) Size() (int64, error)

func (*MMap) Sync

func (mmap *MMap) Sync() error

func (*MMap) Write

func (mmap *MMap) Write([]byte) (int, error)

Jump to

Keyboard shortcuts

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