timestamp.pb.go 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: google/protobuf/timestamp.proto
  3. package known_proto
  4. import (
  5. protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
  6. protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
  7. protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
  8. protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
  9. sync "sync"
  10. )
  11. const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
  12. // A Timestamp represents a point in time independent of any time zone or local
  13. // calendar, encoded as a count of seconds and fractions of seconds at
  14. // nanosecond resolution. The count is relative to an epoch at UTC midnight on
  15. // January 1, 1970, in the proleptic Gregorian calendar which extends the
  16. // Gregorian calendar backwards to year one.
  17. //
  18. // All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
  19. // second table is needed for interpretation, using a [24-hour linear
  20. // smear](https://developers.google.com/time/smear).
  21. //
  22. // The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
  23. // restricting to that range, we ensure that we can convert to and from [RFC
  24. // 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
  25. //
  26. // # Examples
  27. //
  28. // Example 1: Compute Timestamp from POSIX `time()`.
  29. //
  30. // Timestamp timestamp;
  31. // timestamp.set_seconds(time(NULL));
  32. // timestamp.set_nanos(0);
  33. //
  34. // Example 2: Compute Timestamp from POSIX `gettimeofday()`.
  35. //
  36. // struct timeval tv;
  37. // gettimeofday(&tv, NULL);
  38. //
  39. // Timestamp timestamp;
  40. // timestamp.set_seconds(tv.tv_sec);
  41. // timestamp.set_nanos(tv.tv_usec * 1000);
  42. //
  43. // Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
  44. //
  45. // FILETIME ft;
  46. // GetSystemTimeAsFileTime(&ft);
  47. // UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
  48. //
  49. // // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
  50. // // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
  51. // Timestamp timestamp;
  52. // timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
  53. // timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
  54. //
  55. // Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
  56. //
  57. // long millis = System.currentTimeMillis();
  58. //
  59. // Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
  60. // .setNanos((int) ((millis % 1000) * 1000000)).build();
  61. //
  62. //
  63. // Example 5: Compute Timestamp from current time in Python.
  64. //
  65. // timestamp = Timestamp()
  66. // timestamp.GetCurrentTime()
  67. //
  68. // # JSON Mapping
  69. //
  70. // In JSON format, the Timestamp type is encoded as a string in the
  71. // [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
  72. // format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
  73. // where {year} is always expressed using four digits while {month}, {day},
  74. // {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
  75. // seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
  76. // are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
  77. // is required. A proto3 JSON serializer should always use UTC (as indicated by
  78. // "Z") when printing the Timestamp type and a proto3 JSON parser should be
  79. // able to accept both UTC and other timezones (as indicated by an offset).
  80. //
  81. // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
  82. // 01:30 UTC on January 15, 2017.
  83. //
  84. // In JavaScript, one can convert a Date object to this format using the
  85. // standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
  86. // method. In Python, a standard `datetime.datetime` object can be converted
  87. // to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
  88. // with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
  89. // can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
  90. // http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
  91. // ) to obtain a formatter capable of generating timestamps in this format.
  92. //
  93. //
  94. type Timestamp struct {
  95. // Represents seconds of UTC time since Unix epoch
  96. // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
  97. // 9999-12-31T23:59:59Z inclusive.
  98. Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"`
  99. // Non-negative fractions of a second at nanosecond resolution. Negative
  100. // second values with fractions must still have non-negative nanos values
  101. // that count forward in time. Must be from 0 to 999,999,999
  102. // inclusive.
  103. Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"`
  104. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  105. XXX_unrecognized protoimpl.UnknownFields `json:"-"`
  106. XXX_sizecache protoimpl.SizeCache `json:"-"`
  107. }
  108. func (x *Timestamp) Reset() {
  109. *x = Timestamp{}
  110. }
  111. func (x *Timestamp) String() string {
  112. return protoimpl.X.MessageStringOf(x)
  113. }
  114. func (*Timestamp) ProtoMessage() {}
  115. func (x *Timestamp) ProtoReflect() protoreflect.Message {
  116. return file_google_protobuf_timestamp_proto_msgTypes[0].MessageOf(x)
  117. }
  118. func (m *Timestamp) XXX_Methods() *protoiface.Methods {
  119. return file_google_protobuf_timestamp_proto_msgTypes[0].Methods()
  120. }
  121. // Deprecated: Use Timestamp.ProtoReflect.Type instead.
  122. func (*Timestamp) Descriptor() ([]byte, []int) {
  123. return file_google_protobuf_timestamp_proto_rawDescGZIP(), []int{0}
  124. }
  125. func (*Timestamp) XXX_WellKnownType() string { return "Timestamp" }
  126. func (x *Timestamp) GetSeconds() int64 {
  127. if x != nil {
  128. return x.Seconds
  129. }
  130. return 0
  131. }
  132. func (x *Timestamp) GetNanos() int32 {
  133. if x != nil {
  134. return x.Nanos
  135. }
  136. return 0
  137. }
  138. var File_google_protobuf_timestamp_proto protoreflect.FileDescriptor
  139. var file_google_protobuf_timestamp_proto_rawDesc = []byte{
  140. 0x0a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
  141. 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74,
  142. 0x6f, 0x12, 0x0f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
  143. 0x75, 0x66, 0x22, 0x3b, 0x0a, 0x09, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12,
  144. 0x18, 0x0a, 0x07, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
  145. 0x52, 0x07, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x61, 0x6e,
  146. 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x42,
  147. 0x88, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
  148. 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x0e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
  149. 0x6d, 0x70, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75,
  150. 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f,
  151. 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x32, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6b,
  152. 0x6e, 0x6f, 0x77, 0x6e, 0x3b, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
  153. 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1e, 0x47, 0x6f, 0x6f, 0x67,
  154. 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x57, 0x65, 0x6c, 0x6c,
  155. 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
  156. 0x6f, 0x33,
  157. }
  158. var (
  159. file_google_protobuf_timestamp_proto_rawDescOnce sync.Once
  160. file_google_protobuf_timestamp_proto_rawDescData = file_google_protobuf_timestamp_proto_rawDesc
  161. )
  162. func file_google_protobuf_timestamp_proto_rawDescGZIP() []byte {
  163. file_google_protobuf_timestamp_proto_rawDescOnce.Do(func() {
  164. file_google_protobuf_timestamp_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_protobuf_timestamp_proto_rawDescData)
  165. })
  166. return file_google_protobuf_timestamp_proto_rawDescData
  167. }
  168. var file_google_protobuf_timestamp_proto_msgTypes = make([]protoimpl.MessageType, 1)
  169. var file_google_protobuf_timestamp_proto_goTypes = []interface{}{
  170. (*Timestamp)(nil), // 0: google.protobuf.Timestamp
  171. }
  172. var file_google_protobuf_timestamp_proto_depIdxs = []int32{}
  173. func init() { file_google_protobuf_timestamp_proto_init() }
  174. func file_google_protobuf_timestamp_proto_init() {
  175. if File_google_protobuf_timestamp_proto != nil {
  176. return
  177. }
  178. File_google_protobuf_timestamp_proto = protoimpl.FileBuilder{
  179. RawDescriptor: file_google_protobuf_timestamp_proto_rawDesc,
  180. GoTypes: file_google_protobuf_timestamp_proto_goTypes,
  181. DependencyIndexes: file_google_protobuf_timestamp_proto_depIdxs,
  182. MessageOutputTypes: file_google_protobuf_timestamp_proto_msgTypes,
  183. FilesRegistry: protoregistry.GlobalFiles,
  184. TypesRegistry: protoregistry.GlobalTypes,
  185. }.Init()
  186. file_google_protobuf_timestamp_proto_rawDesc = nil
  187. file_google_protobuf_timestamp_proto_goTypes = nil
  188. file_google_protobuf_timestamp_proto_depIdxs = nil
  189. }