database.proto 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright (C) 2018 The Syncthing Authors.
  2. //
  3. // This Source Code Form is subject to the terms of the Mozilla Public
  4. // License, v. 2.0. If a copy of the MPL was not distributed with this file,
  5. // You can obtain one at https://mozilla.org/MPL/2.0/.
  6. syntax = "proto3";
  7. package main;
  8. import "repos/protobuf/gogoproto/gogo.proto";
  9. option (gogoproto.goproto_getters_all) = false;
  10. option (gogoproto.goproto_unkeyed_all) = false;
  11. option (gogoproto.goproto_unrecognized_all) = false;
  12. option (gogoproto.goproto_sizecache_all) = false;
  13. message DatabaseRecord {
  14. repeated DatabaseAddress addresses = 1 [(gogoproto.nullable) = false];
  15. int32 misses = 2; // Number of lookups* without hits
  16. int64 seen = 3; // Unix nanos, last device announce
  17. int64 missed = 4; // Unix nanos, last* failed lookup
  18. }
  19. // *) Not every lookup results in a write, so may not be completely accurate
  20. message ReplicationRecord {
  21. string key = 1;
  22. repeated DatabaseAddress addresses = 2 [(gogoproto.nullable) = false];
  23. int64 seen = 3; // Unix nanos, last device announce
  24. }
  25. message DatabaseAddress {
  26. string address = 1;
  27. int64 expires = 2; // Unix nanos
  28. }