Simple, idiomatic write-ahead log
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
maze d61e41c1bc Allow specification of sync interval 1 year ago
.gitignore Initial commit 1 year ago
LICENSE Initial commit 1 year ago
Makefile Initial import 1 year ago
README.md Rewrite 1 year ago
doc.go Allow specification of sync interval 1 year ago
file.go Allow specification of sync interval 1 year ago
file_test.go Allow specification of sync interval 1 year ago
go.mod Rewrite 1 year ago
log.go Doc fixes 1 year ago
log_example_test.go Allow specification of sync interval 1 year ago
log_test.go Rewrite 1 year ago
memory.go Rewrite 1 year ago
memory_test.go Rewrite 1 year ago
record.go Rewrite 1 year ago

README.md

wal

Simple, idiomatic write-ahead log.

Usage

Each write-ahead log requires a dedicated directory for writing log files, writing to a directory containing other files is undefined behaviour. Two methods exist to open a new WAL, Open which uses DefaultSize or OpenSize which allows the user to specify a maximum log file size. The log file writer checks the log file size before writing and advances to the next log file if required, but only if the log is not empty, allowing for writes beyond the specified size.

The maximum log file record size is 4294967295 bytes, or 4GB. If larger chunk size is required, the caller has to write the contents in chunks of 4GB and recombine them later.