timestamp.pb.go 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: google/protobuf/timestamp.proto
  3. /*
  4. Package timestamp is a generated protocol buffer package.
  5. It is generated from these files:
  6. google/protobuf/timestamp.proto
  7. It has these top-level messages:
  8. Timestamp
  9. */
  10. package timestamp
  11. import proto "github.com/golang/protobuf/proto"
  12. import fmt "fmt"
  13. import math "math"
  14. // Reference imports to suppress errors if they are not otherwise used.
  15. var _ = proto.Marshal
  16. var _ = fmt.Errorf
  17. var _ = math.Inf
  18. // This is a compile-time assertion to ensure that this generated file
  19. // is compatible with the proto package it is being compiled against.
  20. // A compilation error at this line likely means your copy of the
  21. // proto package needs to be updated.
  22. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  23. // A Timestamp represents a point in time independent of any time zone
  24. // or calendar, represented as seconds and fractions of seconds at
  25. // nanosecond resolution in UTC Epoch time. It is encoded using the
  26. // Proleptic Gregorian Calendar which extends the Gregorian calendar
  27. // backwards to year one. It is encoded assuming all minutes are 60
  28. // seconds long, i.e. leap seconds are "smeared" so that no leap second
  29. // table is needed for interpretation. Range is from
  30. // 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.
  31. // By restricting to that range, we ensure that we can convert to
  32. // and from RFC 3339 date strings.
  33. // See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt).
  34. //
  35. // # Examples
  36. //
  37. // Example 1: Compute Timestamp from POSIX `time()`.
  38. //
  39. // Timestamp timestamp;
  40. // timestamp.set_seconds(time(NULL));
  41. // timestamp.set_nanos(0);
  42. //
  43. // Example 2: Compute Timestamp from POSIX `gettimeofday()`.
  44. //
  45. // struct timeval tv;
  46. // gettimeofday(&tv, NULL);
  47. //
  48. // Timestamp timestamp;
  49. // timestamp.set_seconds(tv.tv_sec);
  50. // timestamp.set_nanos(tv.tv_usec * 1000);
  51. //
  52. // Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
  53. //
  54. // FILETIME ft;
  55. // GetSystemTimeAsFileTime(&ft);
  56. // UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
  57. //
  58. // // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
  59. // // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
  60. // Timestamp timestamp;
  61. // timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
  62. // timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
  63. //
  64. // Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
  65. //
  66. // long millis = System.currentTimeMillis();
  67. //
  68. // Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
  69. // .setNanos((int) ((millis % 1000) * 1000000)).build();
  70. //
  71. //
  72. // Example 5: Compute Timestamp from current time in Python.
  73. //
  74. // timestamp = Timestamp()
  75. // timestamp.GetCurrentTime()
  76. //
  77. // # JSON Mapping
  78. //
  79. // In JSON format, the Timestamp type is encoded as a string in the
  80. // [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
  81. // format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
  82. // where {year} is always expressed using four digits while {month}, {day},
  83. // {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
  84. // seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
  85. // are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
  86. // is required, though only UTC (as indicated by "Z") is presently supported.
  87. //
  88. // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
  89. // 01:30 UTC on January 15, 2017.
  90. //
  91. // In JavaScript, one can convert a Date object to this format using the
  92. // standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString]
  93. // method. In Python, a standard `datetime.datetime` object can be converted
  94. // to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
  95. // with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
  96. // can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
  97. // http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--)
  98. // to obtain a formatter capable of generating timestamps in this format.
  99. //
  100. //
  101. type Timestamp struct {
  102. // Represents seconds of UTC time since Unix epoch
  103. // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
  104. // 9999-12-31T23:59:59Z inclusive.
  105. Seconds int64 `protobuf:"varint,1,opt,name=seconds" json:"seconds,omitempty"`
  106. // Non-negative fractions of a second at nanosecond resolution. Negative
  107. // second values with fractions must still have non-negative nanos values
  108. // that count forward in time. Must be from 0 to 999,999,999
  109. // inclusive.
  110. Nanos int32 `protobuf:"varint,2,opt,name=nanos" json:"nanos,omitempty"`
  111. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  112. XXX_unrecognized []byte `protobuf_unrecognized:"proto3" json:"-"`
  113. XXX_sizecache int32 `json:"-"`
  114. }
  115. func (m *Timestamp) Reset() { *m = Timestamp{} }
  116. func (m *Timestamp) String() string { return proto.CompactTextString(m) }
  117. func (*Timestamp) ProtoMessage() {}
  118. func (*Timestamp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
  119. func (*Timestamp) XXX_WellKnownType() string { return "Timestamp" }
  120. func (m *Timestamp) Unmarshal(b []byte) error {
  121. return xxx_messageInfo_Timestamp.Unmarshal(m, b)
  122. }
  123. func (m *Timestamp) Marshal(b []byte, deterministic bool) ([]byte, error) {
  124. return xxx_messageInfo_Timestamp.Marshal(b, m, deterministic)
  125. }
  126. func (dst *Timestamp) XXX_Merge(src proto.Message) {
  127. xxx_messageInfo_Timestamp.Merge(dst, src)
  128. }
  129. func (m *Timestamp) XXX_Size() int {
  130. return xxx_messageInfo_Timestamp.Size(m)
  131. }
  132. func (m *Timestamp) XXX_DiscardUnknown() {
  133. xxx_messageInfo_Timestamp.DiscardUnknown(m)
  134. }
  135. var xxx_messageInfo_Timestamp proto.InternalMessageInfo
  136. func (m *Timestamp) GetSeconds() int64 {
  137. if m != nil {
  138. return m.Seconds
  139. }
  140. return 0
  141. }
  142. func (m *Timestamp) GetNanos() int32 {
  143. if m != nil {
  144. return m.Nanos
  145. }
  146. return 0
  147. }
  148. func init() {
  149. proto.RegisterType((*Timestamp)(nil), "google.protobuf.Timestamp")
  150. }
  151. func init() { proto.RegisterFile("google/protobuf/timestamp.proto", fileDescriptor0) }
  152. var fileDescriptor0 = []byte{
  153. // 191 bytes of a gzipped FileDescriptorProto
  154. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xcf, 0xcf, 0x4f,
  155. 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0xc9, 0xcc, 0x4d,
  156. 0x2d, 0x2e, 0x49, 0xcc, 0x2d, 0xd0, 0x03, 0x0b, 0x09, 0xf1, 0x43, 0x14, 0xe8, 0xc1, 0x14, 0x28,
  157. 0x59, 0x73, 0x71, 0x86, 0xc0, 0xd4, 0x08, 0x49, 0x70, 0xb1, 0x17, 0xa7, 0x26, 0xe7, 0xe7, 0xa5,
  158. 0x14, 0x4b, 0x30, 0x2a, 0x30, 0x6a, 0x30, 0x07, 0xc1, 0xb8, 0x42, 0x22, 0x5c, 0xac, 0x79, 0x89,
  159. 0x79, 0xf9, 0xc5, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xac, 0x41, 0x10, 0x8e, 0x53, 0x1d, 0x97, 0x70,
  160. 0x72, 0x7e, 0xae, 0x1e, 0x9a, 0x99, 0x4e, 0x7c, 0x70, 0x13, 0x03, 0x40, 0x42, 0x01, 0x8c, 0x51,
  161. 0xda, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xe9, 0xf9, 0x39, 0x89,
  162. 0x79, 0xe9, 0x08, 0x27, 0x16, 0x94, 0x54, 0x16, 0xa4, 0x16, 0x23, 0x5c, 0xfa, 0x83, 0x91, 0x71,
  163. 0x11, 0x13, 0xb3, 0x7b, 0x80, 0xd3, 0x2a, 0x26, 0x39, 0x77, 0x88, 0xc9, 0x01, 0x50, 0xb5, 0x7a,
  164. 0xe1, 0xa9, 0x39, 0x39, 0xde, 0x79, 0xf9, 0xe5, 0x79, 0x21, 0x20, 0x3d, 0x49, 0x6c, 0x60, 0x43,
  165. 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xbc, 0x77, 0x4a, 0x07, 0xf7, 0x00, 0x00, 0x00,
  166. }