database.proto 1.0 KB

1234567891011121314151617181920212223242526272829303132
  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. int64 seen = 3; // Unix nanos, last device announce
  16. }
  17. message ReplicationRecord {
  18. bytes key = 1; // raw 32 byte device ID
  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. }