Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions wal/command.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
syntax = "proto3";

package wal;

option go_package = "./wal";

// CommandPayload represents the payload for command entries in WAL
message Command {
// Log Sequence Number
uint64 lsn = 1;
// The wire command bytes
bytes payload = 2;
}
26 changes: 17 additions & 9 deletions wal/wal.proto
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
syntax = "proto3";

package wal;

option go_package = "./wal";

enum ElementType {
ELEMENT_TYPE_NOOP = 0;
ELEMENT_TYPE_COMMAND = 1;
// EntryType defines the type of WAL entry
enum WALEntryType {
WAL_ENTRY_TYPE_COMMAND = 0;
}

message Element {
uint64 lsn = 1;
int64 timestamp = 2;
ElementType element_type = 3;
bytes payload = 4;
}
// WALEntry represents a single entry in the Write-Ahead Log
message WALEntry {
// CRC32 checksum of the entry data
uint32 crc32 = 1;
// Size of the WAL entry in bytes
uint32 size = 2;
// The actual WAL payload
bytes payload = 3;
// Timestamp when the entry was created
int64 timestamp = 4;
// Type of the entry
WALEntryType entry_type = 5;
}