timestamp.pb.go 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: google/protobuf/timestamp.proto
  3. package timestamp
  4. import (
  5. proto "github.com/golang/protobuf/proto"
  6. protoapi "github.com/golang/protobuf/protoapi"
  7. )
  8. // This is a compile-time assertion to ensure that this generated file
  9. // is compatible with the proto package it is being compiled against.
  10. // A compilation error at this line likely means your copy of the
  11. // proto package needs to be updated.
  12. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
  13. // A Timestamp represents a point in time independent of any time zone
  14. // or calendar, represented as seconds and fractions of seconds at
  15. // nanosecond resolution in UTC Epoch time. It is encoded using the
  16. // Proleptic Gregorian Calendar which extends the Gregorian calendar
  17. // backwards to year one. It is encoded assuming all minutes are 60
  18. // seconds long, i.e. leap seconds are "smeared" so that no leap second
  19. // table is needed for interpretation. Range is from
  20. // 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.
  21. // By restricting to that range, we ensure that we can convert to
  22. // and from RFC 3339 date strings.
  23. // See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt).
  24. //
  25. // # Examples
  26. //
  27. // Example 1: Compute Timestamp from POSIX `time()`.
  28. //
  29. // Timestamp timestamp;
  30. // timestamp.set_seconds(time(NULL));
  31. // timestamp.set_nanos(0);
  32. //
  33. // Example 2: Compute Timestamp from POSIX `gettimeofday()`.
  34. //
  35. // struct timeval tv;
  36. // gettimeofday(&tv, NULL);
  37. //
  38. // Timestamp timestamp;
  39. // timestamp.set_seconds(tv.tv_sec);
  40. // timestamp.set_nanos(tv.tv_usec * 1000);
  41. //
  42. // Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
  43. //
  44. // FILETIME ft;
  45. // GetSystemTimeAsFileTime(&ft);
  46. // UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
  47. //
  48. // // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
  49. // // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
  50. // Timestamp timestamp;
  51. // timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
  52. // timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
  53. //
  54. // Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
  55. //
  56. // long millis = System.currentTimeMillis();
  57. //
  58. // Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
  59. // .setNanos((int) ((millis % 1000) * 1000000)).build();
  60. //
  61. //
  62. // Example 5: Compute Timestamp from current time in Python.
  63. //
  64. // timestamp = Timestamp()
  65. // timestamp.GetCurrentTime()
  66. //
  67. // # JSON Mapping
  68. //
  69. // In JSON format, the Timestamp type is encoded as a string in the
  70. // [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
  71. // format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
  72. // where {year} is always expressed using four digits while {month}, {day},
  73. // {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
  74. // seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
  75. // are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
  76. // is required. A proto3 JSON serializer should always use UTC (as indicated by
  77. // "Z") when printing the Timestamp type and a proto3 JSON parser should be
  78. // able to accept both UTC and other timezones (as indicated by an offset).
  79. //
  80. // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
  81. // 01:30 UTC on January 15, 2017.
  82. //
  83. // In JavaScript, one can convert a Date object to this format using the
  84. // standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString]
  85. // method. In Python, a standard `datetime.datetime` object can be converted
  86. // to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
  87. // with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
  88. // can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
  89. // http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--
  90. // ) to obtain a formatter capable of generating timestamps in this format.
  91. //
  92. //
  93. type Timestamp struct {
  94. // Represents seconds of UTC time since Unix epoch
  95. // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
  96. // 9999-12-31T23:59:59Z inclusive.
  97. Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"`
  98. // Non-negative fractions of a second at nanosecond resolution. Negative
  99. // second values with fractions must still have non-negative nanos values
  100. // that count forward in time. Must be from 0 to 999,999,999
  101. // inclusive.
  102. Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"`
  103. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  104. XXX_unrecognized []byte `json:"-"`
  105. XXX_sizecache int32 `json:"-"`
  106. }
  107. func (m *Timestamp) Reset() { *m = Timestamp{} }
  108. func (m *Timestamp) String() string { return proto.CompactTextString(m) }
  109. func (*Timestamp) ProtoMessage() {}
  110. func (*Timestamp) Descriptor() ([]byte, []int) {
  111. return xxx_File_google_protobuf_timestamp_proto_rawdesc_gzipped, []int{0}
  112. }
  113. func (*Timestamp) XXX_WellKnownType() string { return "Timestamp" }
  114. func (m *Timestamp) XXX_Unmarshal(b []byte) error {
  115. return xxx_messageInfo_Timestamp.Unmarshal(m, b)
  116. }
  117. func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  118. return xxx_messageInfo_Timestamp.Marshal(b, m, deterministic)
  119. }
  120. func (m *Timestamp) XXX_Merge(src proto.Message) {
  121. xxx_messageInfo_Timestamp.Merge(m, src)
  122. }
  123. func (m *Timestamp) XXX_Size() int {
  124. return xxx_messageInfo_Timestamp.Size(m)
  125. }
  126. func (m *Timestamp) XXX_DiscardUnknown() {
  127. xxx_messageInfo_Timestamp.DiscardUnknown(m)
  128. }
  129. var xxx_messageInfo_Timestamp proto.InternalMessageInfo
  130. func (m *Timestamp) GetSeconds() int64 {
  131. if m != nil {
  132. return m.Seconds
  133. }
  134. return 0
  135. }
  136. func (m *Timestamp) GetNanos() int32 {
  137. if m != nil {
  138. return m.Nanos
  139. }
  140. return 0
  141. }
  142. func init() {
  143. proto.RegisterFile("google/protobuf/timestamp.proto", xxx_File_google_protobuf_timestamp_proto_rawdesc_gzipped)
  144. proto.RegisterType((*Timestamp)(nil), "google.protobuf.Timestamp")
  145. }
  146. var xxx_File_google_protobuf_timestamp_proto_rawdesc = []byte{
  147. // 247 bytes of the wire-encoded FileDescriptorProto
  148. 0x0a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
  149. 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74,
  150. 0x6f, 0x12, 0x0f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
  151. 0x75, 0x66, 0x22, 0x3b, 0x0a, 0x09, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12,
  152. 0x18, 0x0a, 0x07, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
  153. 0x52, 0x07, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x61, 0x6e,
  154. 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x42,
  155. 0x7e, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
  156. 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x0e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
  157. 0x70, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
  158. 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74,
  159. 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x69, 0x6d, 0x65,
  160. 0x73, 0x74, 0x61, 0x6d, 0x70, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02,
  161. 0x1e, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
  162. 0x2e, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62,
  163. 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
  164. }
  165. var xxx_File_google_protobuf_timestamp_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_google_protobuf_timestamp_proto_rawdesc)