driver

package
v0.0.0-...-6438891 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 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
}

FileIO Standard file IO

func NewFileIOManager

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

func (*FileIO) Close

func (f *FileIO) Close() error

func (*FileIO) Read

func (f *FileIO) Read(bytes []byte, offset int64) (int, error)

func (*FileIO) Size

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

func (*FileIO) Sync

func (f *FileIO) Sync() error

func (*FileIO) Write

func (f *FileIO) Write(bytes []byte) (int, error)

type IOManager

type IOManager interface {
	// Read By specifying the location data in a read the file
	Read([]byte, int64) (int, error)

	// Write Writing bytes of data to a file
	Write([]byte) (int, error)

	// Sync Make data persistent
	Sync() error

	//Close Close the driver
	Close() error

	Size() (int64, error)
}

func NewIOManager

func NewIOManager(fileName string) (IOManager, error)

NewIOManager Init IOManager instance attention! the IOManager is only support FileIO

type MMap

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

func NewMMap

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

func (*MMap) Close

func (m *MMap) Close() error

func (*MMap) Read

func (m *MMap) Read(bytes []byte, offset int64) (int, error)

func (*MMap) Size

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

func (*MMap) Sync

func (m *MMap) Sync() error

func (*MMap) Write

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

Jump to

Keyboard shortcuts

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