timestamp.pb.go 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. // Code generated by protoc-gen-go.
  2. // source: github.com/golang/protobuf/ptypes/timestamp/timestamp.proto
  3. // DO NOT EDIT!
  4. /*
  5. Package timestamp is a generated protocol buffer package.
  6. It is generated from these files:
  7. github.com/golang/protobuf/ptypes/timestamp/timestamp.proto
  8. It has these top-level messages:
  9. Timestamp
  10. */
  11. package timestamp
  12. import proto "github.com/golang/protobuf/proto"
  13. import fmt "fmt"
  14. import math "math"
  15. // Reference imports to suppress errors if they are not otherwise used.
  16. var _ = proto.Marshal
  17. var _ = fmt.Errorf
  18. var _ = math.Inf
  19. // This is a compile-time assertion to ensure that this generated file
  20. // is compatible with the proto package it is being compiled against.
  21. const _ = proto.ProtoPackageIsVersion1
  22. // A Timestamp represents a point in time independent of any time zone
  23. // or calendar, represented as seconds and fractions of seconds at
  24. // nanosecond resolution in UTC Epoch time. It is encoded using the
  25. // Proleptic Gregorian Calendar which extends the Gregorian calendar
  26. // backwards to year one. It is encoded assuming all minutes are 60
  27. // seconds long, i.e. leap seconds are "smeared" so that no leap second
  28. // table is needed for interpretation. Range is from
  29. // 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.
  30. // By restricting to that range, we ensure that we can convert to
  31. // and from RFC 3339 date strings.
  32. // See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt).
  33. //
  34. // Example 1: Compute Timestamp from POSIX `time()`.
  35. //
  36. // Timestamp timestamp;
  37. // timestamp.set_seconds(time(NULL));
  38. // timestamp.set_nanos(0);
  39. //
  40. // Example 2: Compute Timestamp from POSIX `gettimeofday()`.
  41. //
  42. // struct timeval tv;
  43. // gettimeofday(&tv, NULL);
  44. //
  45. // Timestamp timestamp;
  46. // timestamp.set_seconds(tv.tv_sec);
  47. // timestamp.set_nanos(tv.tv_usec * 1000);
  48. //
  49. // Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
  50. //
  51. // FILETIME ft;
  52. // GetSystemTimeAsFileTime(&ft);
  53. // UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
  54. //
  55. // // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
  56. // // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
  57. // Timestamp timestamp;
  58. // timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
  59. // timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
  60. //
  61. // Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
  62. //
  63. // long millis = System.currentTimeMillis();
  64. //
  65. // Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
  66. // .setNanos((int) ((millis % 1000) * 1000000)).build();
  67. //
  68. //
  69. // Example 5: Compute Timestamp from current time in Python.
  70. //
  71. // now = time.time()
  72. // seconds = int(now)
  73. // nanos = int((now - seconds) * 10**9)
  74. // timestamp = Timestamp(seconds=seconds, nanos=nanos)
  75. //
  76. //
  77. type Timestamp struct {
  78. // Represents seconds of UTC time since Unix epoch
  79. // 1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to
  80. // 9999-12-31T23:59:59Z inclusive.
  81. Seconds int64 `protobuf:"varint,1,opt,name=seconds" json:"seconds,omitempty"`
  82. // Non-negative fractions of a second at nanosecond resolution. Negative
  83. // second values with fractions must still have non-negative nanos values
  84. // that count forward in time. Must be from 0 to 999,999,999
  85. // inclusive.
  86. Nanos int32 `protobuf:"varint,2,opt,name=nanos" json:"nanos,omitempty"`
  87. }
  88. func (m *Timestamp) Reset() { *m = Timestamp{} }
  89. func (m *Timestamp) String() string { return proto.CompactTextString(m) }
  90. func (*Timestamp) ProtoMessage() {}
  91. func (*Timestamp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
  92. func (*Timestamp) XXX_WellKnownType() string { return "Timestamp" }
  93. func init() {
  94. proto.RegisterType((*Timestamp)(nil), "google.protobuf.Timestamp")
  95. }
  96. var fileDescriptor0 = []byte{
  97. // 192 bytes of a gzipped FileDescriptorProto
  98. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xb2, 0x4e, 0xcf, 0x2c, 0xc9,
  99. 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0x2f, 0x28,
  100. 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0x28, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2f, 0xc9,
  101. 0xcc, 0x4d, 0x2d, 0x2e, 0x49, 0xcc, 0x2d, 0x40, 0xb0, 0xf4, 0xc0, 0x6a, 0x84, 0xf8, 0xd3, 0xf3,
  102. 0xf3, 0xd3, 0x73, 0x52, 0xf5, 0x60, 0x3a, 0x94, 0xac, 0xb9, 0x38, 0x43, 0x60, 0x6a, 0x84, 0x24,
  103. 0xb8, 0xd8, 0x8b, 0x53, 0x93, 0xf3, 0xf3, 0x52, 0x8a, 0x25, 0x18, 0x15, 0x18, 0x35, 0x98, 0x83,
  104. 0x60, 0x5c, 0x21, 0x11, 0x2e, 0xd6, 0xbc, 0xc4, 0xbc, 0xfc, 0x62, 0x09, 0x26, 0xa0, 0x38, 0x6b,
  105. 0x10, 0x84, 0xe3, 0xd4, 0xc8, 0xc8, 0x25, 0x0c, 0x74, 0x86, 0x1e, 0x9a, 0xa1, 0x4e, 0x7c, 0x70,
  106. 0x23, 0x03, 0x40, 0x42, 0x01, 0x8c, 0x51, 0xda, 0x24, 0x38, 0x7a, 0x01, 0x23, 0xe3, 0x0f, 0x46,
  107. 0xc6, 0x45, 0x4c, 0xcc, 0xee, 0x01, 0x4e, 0xab, 0x98, 0xe4, 0xdc, 0x21, 0x86, 0x07, 0x40, 0x95,
  108. 0xeb, 0x85, 0xa7, 0xe6, 0xe4, 0x78, 0xe7, 0xe5, 0x97, 0xe7, 0x85, 0x80, 0xb4, 0x25, 0xb1, 0x81,
  109. 0xcd, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x17, 0x5f, 0xb7, 0xdc, 0x17, 0x01, 0x00, 0x00,
  110. }