database.proto 1.1 KB

123456789101112131415161718192021222324252627282930313233
  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 "github.com/gogo/protobuf/gogoproto/gogo.proto";
  9. option (gogoproto.goproto_getters_all) = false;
  10. message DatabaseRecord {
  11. repeated DatabaseAddress addresses = 1 [(gogoproto.nullable) = false];
  12. int32 misses = 2; // Number of lookups* without hits
  13. int64 seen = 3; // Unix nanos, last device announce
  14. int64 missed = 4; // Unix nanos, last* failed lookup
  15. }
  16. // *) Not every lookup results in a write, so may not be completely accurate
  17. message ReplicationRecord {
  18. string key = 1;
  19. repeated DatabaseAddress addresses = 2 [(gogoproto.nullable) = false];
  20. int64 seen = 3; // Unix nanos, last device announce
  21. }
  22. message DatabaseAddress {
  23. string address = 1;
  24. int64 expires = 2; // Unix nanos
  25. }