go-libp2p-peerstore/pb/pstore.proto
Raúl Kripalani c423e9e997 pstoreds: migrate from strict TTL to GC-based expiry.
Each entry in the address book KV store now represents a full peer
with all its addresses. Expiries and TTLs are kept inline. Records are
serialised with Protobuf.

Housekeeping is performed on retrieve, and via a periodic GC routine.
The architecture mimics a write-through cache, although not strictly.
2018-11-13 16:57:51 +00:00

33 lines
955 B
Protocol Buffer

syntax = "proto3";
package pstore.pb;
import "google/protobuf/timestamp.proto";
import "google/protobuf/duration.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.benchgen_all) = true;
option (gogoproto.populate_all) = true;
// AddrBookRecord represents a record for a peer in the address book.
message AddrBookRecord {
// The peer ID.
bytes id = 1;
// The timestamp where purging needs to happen.
google.protobuf.Timestamp nextVisit = 2 [(gogoproto.stdtime) = true];
// The multiaddresses.
map<string, AddrEntry> addrs = 3;
// AddrEntry represents a single multiaddress.
message AddrEntry {
// The point in time when this address expires.
google.protobuf.Timestamp expiry = 2 [(gogoproto.stdtime) = true];
// The original TTL of this address.
google.protobuf.Duration ttl = 3 [(gogoproto.stdduration) = true];
}
}