syntax = "proto3"; package persist; message PersistRequest { uint64 seqNumber = 1; oneof msg { Set Set = 4; SetWithPrefix SetWithPrefix = 5; GetRequest GetRequest = 6; FindRequest FindRequest = 7; FindWithDirection FindWithDirection = 8; GetLastRequest GetLastRequest = 9; AppendDigest AppendDigest = 10; AppendStatements AppendStatements = 11; GetStatements GetStatements = 12; WriteFile WriteFile = 13; } } message PersistResponse { uint64 seqNumber = 1; oneof msg { SuccessMessage SuccessMessage = 4; ErrorMessage ErrorMessage = 5; GetResponse GetResponse = 6; FindResponse FindResponse = 7; GetLastResponse GetLastResponse = 8; GetStatementsResponse GetStatementsResponse = 9; } } message SuccessMessage {} message ErrorMessage { string message = 1; } message Set { bytes key = 1; bytes value = 2; } message SetWithPrefix { bytes prefix = 1; bytes key = 2; bytes value = 3; } message GetRequest { bytes key = 1; } message GetResponse { SingleValue value = 1; } message SingleValue { bytes value = 1; } message GetLastRequest {} message GetLastResponse { KeyValuePair kvp = 1; } message AppendDigest { bytes jsonSerial = 1; } message AppendStatements { bytes statementsSerial = 1; } message WriteFile { string fileName = 1; bytes data = 2; } message GetStatements { GetStatementsAccount accountFilter = 1; uint64 maxSize = 2; GetStatementsDatetime date = 3; } message GetStatementsAccount { bytes account = 1; } message GetStatementsDatetime { int32 year = 1; uint32 month = 2; uint32 day = 3; } message GetStatementsResponse { bytes statementsSerial = 1; bool readToEnd = 2; } // find with prefix and return matched results // return result is `FindResponse` message FindRequest { bytes prefix = 1; IterOptions options = 2; bool onlyKey = 3; } // If find the given key then return sequences before/after the key // return result is `FindResponse` message FindWithDirection { bytes key = 1; bool before = 2; // sequence before the specified key IterOptions options = 3; bool onlyKey = 4; } message FindResponse { repeated KeyValuePair kvpList = 1; } message KeyValuePair { bytes key = 1; bytes value = 2; } message IterOptions { uint32 startIndex = 1; uint32 count = 2; }