Skip to content

IO engine library supports BufferedIO/DirectIO/AsyncIO and provides a unified file operation interface.

License

Notifications You must be signed in to change notification settings

nilebit/ioengine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ioengine

IO engine library supports BufferedIO/DirectIO/AsyncIO and provides a unified file operation interface.

usage

Import package:

import (
	"github.com/silentsharer/ioengine"
)
go get github.com/silentsharer/ioengine

example

// create AIO ioengine option
opt := ioengine.DefaultOptions
opt.IOEngine = AIO

fd, err := ioengine.Open("/tmp/test", opt)
if err != nil {
	handler(err)
}
defer fd.Close()

data1, err := ioengine.MemAlign(4*ioengine.BlockSize)
if err != nil {
	handler(err)
}
copy(data1, []byte("hello"))

data2, err := ioengine.MemAlign(4*ioengine.BlockSize)
if err != nil {
	handler(err)
}
copy(data1, []byte("world"))

b := NewBuffers()
b.Write(data1).Write(data2)

fd.WriteAtv(*b, 0)
fd.Append(*b)

About

IO engine library supports BufferedIO/DirectIO/AsyncIO and provides a unified file operation interface.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages