Write ahead log for Go.
- High durability
- Fast writes
- Low memory footprint
- Monotonic indexes
- Log truncation from front or back.
To start using wal
, install Go and run go get
:
$ go get -u github.com/tidwall/wal
This will retrieve the library.
// open a new log file
l, _ := Open("mylog", nil)
// write some entries
l.Write(1, []byte("first entry"))
l.Write(2, []byte("second entry"))
l.Write(3, []byte("third entry"))
// read an entry
data, _ := l.Read(1)
println(string(data)) // output: first entry
// close the log
l.Close()
Josh Baker @tidwall
wal
source code is available under the MIT License.