PageRenderTime 48ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go

https://gitlab.com/jamesclonk-io/stdlib
Go | 271 lines | 130 code | 18 blank | 123 comment | 14 complexity | 310dce38155577a125d6e73b7c8491f2 MD5 | raw file
  1. // Protocol Buffers - Google's data interchange format
  2. // Copyright 2008 Google Inc. All rights reserved.
  3. // https://developers.google.com/protocol-buffers/
  4. //
  5. // Redistribution and use in source and binary forms, with or without
  6. // modification, are permitted provided that the following conditions are
  7. // met:
  8. //
  9. // * Redistributions of source code must retain the above copyright
  10. // notice, this list of conditions and the following disclaimer.
  11. // * Redistributions in binary form must reproduce the above
  12. // copyright notice, this list of conditions and the following disclaimer
  13. // in the documentation and/or other materials provided with the
  14. // distribution.
  15. // * Neither the name of Google Inc. nor the names of its
  16. // contributors may be used to endorse or promote products derived from
  17. // this software without specific prior written permission.
  18. //
  19. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  20. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  22. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  23. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  24. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  25. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  26. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  27. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  28. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  29. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. // Code generated by protoc-gen-go. DO NOT EDIT.
  31. // source: google/protobuf/timestamp.proto
  32. package timestamppb
  33. import (
  34. protoreflect "google.golang.org/protobuf/reflect/protoreflect"
  35. protoimpl "google.golang.org/protobuf/runtime/protoimpl"
  36. reflect "reflect"
  37. sync "sync"
  38. )
  39. // A Timestamp represents a point in time independent of any time zone or local
  40. // calendar, encoded as a count of seconds and fractions of seconds at
  41. // nanosecond resolution. The count is relative to an epoch at UTC midnight on
  42. // January 1, 1970, in the proleptic Gregorian calendar which extends the
  43. // Gregorian calendar backwards to year one.
  44. //
  45. // All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
  46. // second table is needed for interpretation, using a [24-hour linear
  47. // smear](https://developers.google.com/time/smear).
  48. //
  49. // The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
  50. // restricting to that range, we ensure that we can convert to and from [RFC
  51. // 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
  52. //
  53. // # Examples
  54. //
  55. // Example 1: Compute Timestamp from POSIX `time()`.
  56. //
  57. // Timestamp timestamp;
  58. // timestamp.set_seconds(time(NULL));
  59. // timestamp.set_nanos(0);
  60. //
  61. // Example 2: Compute Timestamp from POSIX `gettimeofday()`.
  62. //
  63. // struct timeval tv;
  64. // gettimeofday(&tv, NULL);
  65. //
  66. // Timestamp timestamp;
  67. // timestamp.set_seconds(tv.tv_sec);
  68. // timestamp.set_nanos(tv.tv_usec * 1000);
  69. //
  70. // Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
  71. //
  72. // FILETIME ft;
  73. // GetSystemTimeAsFileTime(&ft);
  74. // UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
  75. //
  76. // // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
  77. // // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
  78. // Timestamp timestamp;
  79. // timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
  80. // timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
  81. //
  82. // Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
  83. //
  84. // long millis = System.currentTimeMillis();
  85. //
  86. // Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
  87. // .setNanos((int) ((millis % 1000) * 1000000)).build();
  88. //
  89. //
  90. // Example 5: Compute Timestamp from current time in Python.
  91. //
  92. // timestamp = Timestamp()
  93. // timestamp.GetCurrentTime()
  94. //
  95. // # JSON Mapping
  96. //
  97. // In JSON format, the Timestamp type is encoded as a string in the
  98. // [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
  99. // format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
  100. // where {year} is always expressed using four digits while {month}, {day},
  101. // {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
  102. // seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
  103. // are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
  104. // is required. A proto3 JSON serializer should always use UTC (as indicated by
  105. // "Z") when printing the Timestamp type and a proto3 JSON parser should be
  106. // able to accept both UTC and other timezones (as indicated by an offset).
  107. //
  108. // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
  109. // 01:30 UTC on January 15, 2017.
  110. //
  111. // In JavaScript, one can convert a Date object to this format using the
  112. // standard
  113. // [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
  114. // method. In Python, a standard `datetime.datetime` object can be converted
  115. // to this format using
  116. // [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
  117. // the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
  118. // the Joda Time's [`ISODateTimeFormat.dateTime()`](
  119. // http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
  120. // ) to obtain a formatter capable of generating timestamps in this format.
  121. //
  122. //
  123. type Timestamp struct {
  124. state protoimpl.MessageState
  125. sizeCache protoimpl.SizeCache
  126. unknownFields protoimpl.UnknownFields
  127. // Represents seconds of UTC time since Unix epoch
  128. // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
  129. // 9999-12-31T23:59:59Z inclusive.
  130. Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"`
  131. // Non-negative fractions of a second at nanosecond resolution. Negative
  132. // second values with fractions must still have non-negative nanos values
  133. // that count forward in time. Must be from 0 to 999,999,999
  134. // inclusive.
  135. Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"`
  136. }
  137. func (x *Timestamp) Reset() {
  138. *x = Timestamp{}
  139. if protoimpl.UnsafeEnabled {
  140. mi := &file_google_protobuf_timestamp_proto_msgTypes[0]
  141. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  142. ms.StoreMessageInfo(mi)
  143. }
  144. }
  145. func (x *Timestamp) String() string {
  146. return protoimpl.X.MessageStringOf(x)
  147. }
  148. func (*Timestamp) ProtoMessage() {}
  149. func (x *Timestamp) ProtoReflect() protoreflect.Message {
  150. mi := &file_google_protobuf_timestamp_proto_msgTypes[0]
  151. if protoimpl.UnsafeEnabled && x != nil {
  152. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  153. if ms.LoadMessageInfo() == nil {
  154. ms.StoreMessageInfo(mi)
  155. }
  156. return ms
  157. }
  158. return mi.MessageOf(x)
  159. }
  160. // Deprecated: Use Timestamp.ProtoReflect.Descriptor instead.
  161. func (*Timestamp) Descriptor() ([]byte, []int) {
  162. return file_google_protobuf_timestamp_proto_rawDescGZIP(), []int{0}
  163. }
  164. func (x *Timestamp) GetSeconds() int64 {
  165. if x != nil {
  166. return x.Seconds
  167. }
  168. return 0
  169. }
  170. func (x *Timestamp) GetNanos() int32 {
  171. if x != nil {
  172. return x.Nanos
  173. }
  174. return 0
  175. }
  176. var File_google_protobuf_timestamp_proto protoreflect.FileDescriptor
  177. var file_google_protobuf_timestamp_proto_rawDesc = []byte{
  178. 0x0a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
  179. 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74,
  180. 0x6f, 0x12, 0x0f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
  181. 0x75, 0x66, 0x22, 0x3b, 0x0a, 0x09, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12,
  182. 0x18, 0x0a, 0x07, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
  183. 0x52, 0x07, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x61, 0x6e,
  184. 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x42,
  185. 0x7e, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
  186. 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x0e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
  187. 0x70, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
  188. 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74,
  189. 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x69, 0x6d, 0x65,
  190. 0x73, 0x74, 0x61, 0x6d, 0x70, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02,
  191. 0x1e, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
  192. 0x2e, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62,
  193. 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
  194. }
  195. var (
  196. file_google_protobuf_timestamp_proto_rawDescOnce sync.Once
  197. file_google_protobuf_timestamp_proto_rawDescData = file_google_protobuf_timestamp_proto_rawDesc
  198. )
  199. func file_google_protobuf_timestamp_proto_rawDescGZIP() []byte {
  200. file_google_protobuf_timestamp_proto_rawDescOnce.Do(func() {
  201. file_google_protobuf_timestamp_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_protobuf_timestamp_proto_rawDescData)
  202. })
  203. return file_google_protobuf_timestamp_proto_rawDescData
  204. }
  205. var file_google_protobuf_timestamp_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
  206. var file_google_protobuf_timestamp_proto_goTypes = []interface{}{
  207. (*Timestamp)(nil), // 0: google.protobuf.Timestamp
  208. }
  209. var file_google_protobuf_timestamp_proto_depIdxs = []int32{
  210. 0, // [0:0] is the sub-list for method output_type
  211. 0, // [0:0] is the sub-list for method input_type
  212. 0, // [0:0] is the sub-list for extension type_name
  213. 0, // [0:0] is the sub-list for extension extendee
  214. 0, // [0:0] is the sub-list for field type_name
  215. }
  216. func init() { file_google_protobuf_timestamp_proto_init() }
  217. func file_google_protobuf_timestamp_proto_init() {
  218. if File_google_protobuf_timestamp_proto != nil {
  219. return
  220. }
  221. if !protoimpl.UnsafeEnabled {
  222. file_google_protobuf_timestamp_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
  223. switch v := v.(*Timestamp); i {
  224. case 0:
  225. return &v.state
  226. case 1:
  227. return &v.sizeCache
  228. case 2:
  229. return &v.unknownFields
  230. default:
  231. return nil
  232. }
  233. }
  234. }
  235. type x struct{}
  236. out := protoimpl.TypeBuilder{
  237. File: protoimpl.DescBuilder{
  238. GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
  239. RawDescriptor: file_google_protobuf_timestamp_proto_rawDesc,
  240. NumEnums: 0,
  241. NumMessages: 1,
  242. NumExtensions: 0,
  243. NumServices: 0,
  244. },
  245. GoTypes: file_google_protobuf_timestamp_proto_goTypes,
  246. DependencyIndexes: file_google_protobuf_timestamp_proto_depIdxs,
  247. MessageInfos: file_google_protobuf_timestamp_proto_msgTypes,
  248. }.Build()
  249. File_google_protobuf_timestamp_proto = out.File
  250. file_google_protobuf_timestamp_proto_rawDesc = nil
  251. file_google_protobuf_timestamp_proto_goTypes = nil
  252. file_google_protobuf_timestamp_proto_depIdxs = nil
  253. }