timestamp.pb.go 9.5 KB

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