io_handler

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const DataFilePermission fs.FileMode = 0644

DataFilePermission permission of every single data file

Variables

This section is empty.

Functions

This section is empty.

Types

type IOHandler

type IOHandler interface {
	// Read Read corresponding data from the specific position of a file
	Read([]byte, int64) (int, error)
	// Write Write data to a file
	Write([]byte) (int, error)
	// Sync Persistent data
	Sync() error
	// Close Close a file
	Close() error
	// Size Get the size of a data file (unit: B)
	Size() (int64, error)
}

IOHandler Abstract I/O interface

func New added in v0.1.1

func New(t IOHandlerType, filePath string) (IOHandler, error)

New Constructs an IOHandler, such as FileIO

type IOHandlerType

type IOHandlerType = int8
const (
	FileIOHandler IOHandlerType = iota + 1
	MemoryMappedIOHandler
)

Jump to

Keyboard shortcuts

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