0
0
mirror of https://github.com/tursodatabase/libsql.git synced 2025-03-07 07:15:38 +00:00
libsql/libsql-replication/proto/replication_log.proto

45 lines
1.2 KiB
Protocol Buffer
Raw Normal View History

2023-01-03 13:53:48 +01:00
syntax = "proto3";
package wal_log;
import "metadata.proto";
2023-01-03 13:53:48 +01:00
message LogOffset {
2023-05-29 15:08:45 +02:00
uint64 next_offset = 1;
2023-01-03 13:53:48 +01:00
}
2023-11-02 16:25:34 +01:00
message HelloRequest {
optional uint64 handshake_version = 1;
}
message HelloResponse {
2023-11-02 16:25:34 +01:00
/// Uuid of the current generation
string generation_id = 1;
/// First frame_no in the current generation
uint64 generation_start_index = 2;
2023-10-24 12:19:36 +02:00
/// id of the replicated log
string log_id = 3;
2023-10-24 12:19:36 +02:00
/// string-encoded Uuid v4 token for the current session, changes on each restart, and must be passed in subsequent requests header.string
/// If the header session token fails to match the current session token, a NO_HELLO error is returned
bytes session_token = 4;
optional uint64 current_replication_index = 5;
metadata.DatabaseConfig config = 6;
}
2023-01-03 13:53:48 +01:00
message Frame {
bytes data = 1;
2023-12-26 11:16:16 +01:00
// if this frames is a commit frame, then this can be set
// to the time when the transaction was commited
optional int64 timestamp = 2;
2023-01-03 13:53:48 +01:00
}
message Frames {
repeated Frame frames = 1;
}
2023-02-13 17:36:49 +01:00
service ReplicationLog {
rpc Hello(HelloRequest) returns (HelloResponse) {}
rpc LogEntries(LogOffset) returns (stream Frame) {}
rpc BatchLogEntries(LogOffset) returns (Frames) {}
2023-03-10 12:40:37 +01:00
rpc Snapshot(LogOffset) returns (stream Frame) {}
2023-01-03 13:53:48 +01:00
}