duration.pb.go 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. // Code generated by protoc-gen-go.
  2. // source: github.com/golang/protobuf/ptypes/duration/duration.proto
  3. // DO NOT EDIT!
  4. /*
  5. Package duration is a generated protocol buffer package.
  6. It is generated from these files:
  7. github.com/golang/protobuf/ptypes/duration/duration.proto
  8. It has these top-level messages:
  9. Duration
  10. */
  11. package duration
  12. import proto "github.com/golang/protobuf/proto"
  13. import fmt "fmt"
  14. import math "math"
  15. // Reference imports to suppress errors if they are not otherwise used.
  16. var _ = proto.Marshal
  17. var _ = fmt.Errorf
  18. var _ = math.Inf
  19. // This is a compile-time assertion to ensure that this generated file
  20. // is compatible with the proto package it is being compiled against.
  21. // A compilation error at this line likely means your copy of the
  22. // proto package needs to be updated.
  23. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  24. // A Duration represents a signed, fixed-length span of time represented
  25. // as a count of seconds and fractions of seconds at nanosecond
  26. // resolution. It is independent of any calendar and concepts like "day"
  27. // or "month". It is related to Timestamp in that the difference between
  28. // two Timestamp values is a Duration and it can be added or subtracted
  29. // from a Timestamp. Range is approximately +-10,000 years.
  30. //
  31. // Example 1: Compute Duration from two Timestamps in pseudo code.
  32. //
  33. // Timestamp start = ...;
  34. // Timestamp end = ...;
  35. // Duration duration = ...;
  36. //
  37. // duration.seconds = end.seconds - start.seconds;
  38. // duration.nanos = end.nanos - start.nanos;
  39. //
  40. // if (duration.seconds < 0 && duration.nanos > 0) {
  41. // duration.seconds += 1;
  42. // duration.nanos -= 1000000000;
  43. // } else if (durations.seconds > 0 && duration.nanos < 0) {
  44. // duration.seconds -= 1;
  45. // duration.nanos += 1000000000;
  46. // }
  47. //
  48. // Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
  49. //
  50. // Timestamp start = ...;
  51. // Duration duration = ...;
  52. // Timestamp end = ...;
  53. //
  54. // end.seconds = start.seconds + duration.seconds;
  55. // end.nanos = start.nanos + duration.nanos;
  56. //
  57. // if (end.nanos < 0) {
  58. // end.seconds -= 1;
  59. // end.nanos += 1000000000;
  60. // } else if (end.nanos >= 1000000000) {
  61. // end.seconds += 1;
  62. // end.nanos -= 1000000000;
  63. // }
  64. //
  65. //
  66. type Duration struct {
  67. // Signed seconds of the span of time. Must be from -315,576,000,000
  68. // to +315,576,000,000 inclusive.
  69. Seconds int64 `protobuf:"varint,1,opt,name=seconds" json:"seconds,omitempty"`
  70. // Signed fractions of a second at nanosecond resolution of the span
  71. // of time. Durations less than one second are represented with a 0
  72. // `seconds` field and a positive or negative `nanos` field. For durations
  73. // of one second or more, a non-zero value for the `nanos` field must be
  74. // of the same sign as the `seconds` field. Must be from -999,999,999
  75. // to +999,999,999 inclusive.
  76. Nanos int32 `protobuf:"varint,2,opt,name=nanos" json:"nanos,omitempty"`
  77. }
  78. func (m *Duration) Reset() { *m = Duration{} }
  79. func (m *Duration) String() string { return proto.CompactTextString(m) }
  80. func (*Duration) ProtoMessage() {}
  81. func (*Duration) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
  82. func (*Duration) XXX_WellKnownType() string { return "Duration" }
  83. func init() {
  84. proto.RegisterType((*Duration)(nil), "google.protobuf.Duration")
  85. }
  86. func init() {
  87. proto.RegisterFile("github.com/golang/protobuf/ptypes/duration/duration.proto", fileDescriptor0)
  88. }
  89. var fileDescriptor0 = []byte{
  90. // 189 bytes of a gzipped FileDescriptorProto
  91. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xb2, 0x4c, 0xcf, 0x2c, 0xc9,
  92. 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0x2f, 0x28,
  93. 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0x28, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x4f, 0x29,
  94. 0x2d, 0x4a, 0x2c, 0xc9, 0xcc, 0xcf, 0x83, 0x33, 0xf4, 0xc0, 0x2a, 0x84, 0xf8, 0xd3, 0xf3, 0xf3,
  95. 0xd3, 0x73, 0x52, 0xf5, 0x60, 0xea, 0x95, 0xac, 0xb8, 0x38, 0x5c, 0xa0, 0x4a, 0x84, 0x24, 0xb8,
  96. 0xd8, 0x8b, 0x53, 0x93, 0xf3, 0xf3, 0x52, 0x8a, 0x25, 0x18, 0x15, 0x18, 0x35, 0x98, 0x83, 0x60,
  97. 0x5c, 0x21, 0x11, 0x2e, 0xd6, 0xbc, 0xc4, 0xbc, 0xfc, 0x62, 0x09, 0x26, 0x05, 0x46, 0x0d, 0xd6,
  98. 0x20, 0x08, 0xc7, 0xa9, 0x86, 0x4b, 0x38, 0x39, 0x3f, 0x57, 0x0f, 0xcd, 0x48, 0x27, 0x5e, 0x98,
  99. 0x81, 0x01, 0x20, 0x91, 0x00, 0xc6, 0x28, 0x2d, 0xe2, 0xdd, 0xbb, 0x80, 0x91, 0x71, 0x11, 0x13,
  100. 0xb3, 0x7b, 0x80, 0xd3, 0x2a, 0x26, 0x39, 0x77, 0x88, 0xb9, 0x01, 0x50, 0xa5, 0x7a, 0xe1, 0xa9,
  101. 0x39, 0x39, 0xde, 0x79, 0xf9, 0xe5, 0x79, 0x21, 0x20, 0x2d, 0x49, 0x6c, 0x60, 0x33, 0x8c, 0x01,
  102. 0x01, 0x00, 0x00, 0xff, 0xff, 0x62, 0xfb, 0xb1, 0x51, 0x0e, 0x01, 0x00, 0x00,
  103. }