feat: initialize project structure and error types
- go.mod with github.com/dailz/go-kv, Go 1.26.3, testify - config/config.go with WalConfig, Validate() with checked arithmetic - errors.go with sentinel errors (ErrCommitUnknown, ErrWriteStopped, etc.) - wal/constants.go with all WAL format constants and enums - wal/header.go with WAL File Header encode/decode (CRC32 IEEE) - wal/record.go with Physical Record codec, block boundary, SplitIntoRecords - wal/entry.go with WAL Entry codec (varint keys/values, OpType, ValueKind) - wal/sequence.go with SequenceManager (atomic, CAS, overflow-safe) - manifest/manifest.go with MANIFEST stub (Load/Save atomic) - manifest/current.go with CURRENT file (WriteCurrent/ReadCurrent) - Comprehensive tests for all modules - .golangci.yml configuration
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package go_kv
|
||||
|
||||
import "errors"
|
||||
|
||||
// ErrCommitUnknown indicates the commit result is indeterminate: the WAL write
|
||||
// was attempted but the caller cannot assume the write definitely failed or
|
||||
// succeeded. The caller must query the commit state before retrying.
|
||||
var ErrCommitUnknown = errors.New("go-kv: commit result unknown")
|
||||
|
||||
// ErrWriteStopped indicates the engine has entered a write-stopped state and
|
||||
// rejects all subsequent writes.
|
||||
var ErrWriteStopped = errors.New("go-kv: write stopped")
|
||||
|
||||
// ErrSequenceExhausted indicates the sequence number space is exhausted. The
|
||||
// engine enters a terminal state requiring database migration or rebuild.
|
||||
var ErrSequenceExhausted = errors.New("go-kv: sequence exhausted")
|
||||
|
||||
// ErrWALCorrupted indicates WAL data corruption was detected.
|
||||
var ErrWALCorrupted = errors.New("go-kv: WAL corrupted")
|
||||
|
||||
// ErrInvalidConfig indicates an invalid configuration was provided.
|
||||
var ErrInvalidConfig = errors.New("go-kv: invalid config")
|
||||
Reference in New Issue
Block a user