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 11 months ago
.gitignore Initial commit 11 months ago
LICENSE Initial commit 11 months ago
Makefile Initial import 11 months ago
README.md Rewrite 11 months ago
doc.go Allow specification of sync interval 11 months ago
file.go Allow specification of sync interval 11 months ago
file_test.go Allow specification of sync interval 11 months ago
go.mod Rewrite 11 months ago
log.go Doc fixes 11 months ago
log_example_test.go Allow specification of sync interval 11 months ago
log_test.go Rewrite 11 months ago
memory.go Rewrite 11 months ago
memory_test.go Rewrite 11 months ago
record.go Rewrite 11 months 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.