duration.pb.go 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. const _ = proto.ProtoPackageIsVersion1
  22. // A Duration represents a signed, fixed-length span of time represented
  23. // as a count of seconds and fractions of seconds at nanosecond
  24. // resolution. It is independent of any calendar and concepts like "day"
  25. // or "month". It is related to Timestamp in that the difference between
  26. // two Timestamp values is a Duration and it can be added or subtracted
  27. // from a Timestamp. Range is approximately +-10,000 years.
  28. //
  29. // Example 1: Compute Duration from two Timestamps in pseudo code.
  30. //
  31. // Timestamp start = ...;
  32. // Timestamp end = ...;
  33. // Duration duration = ...;
  34. //
  35. // duration.seconds = end.seconds - start.seconds;
  36. // duration.nanos = end.nanos - start.nanos;
  37. //
  38. // if (duration.seconds < 0 && duration.nanos > 0) {
  39. // duration.seconds += 1;
  40. // duration.nanos -= 1000000000;
  41. // } else if (durations.seconds > 0 && duration.nanos < 0) {
  42. // duration.seconds -= 1;
  43. // duration.nanos += 1000000000;
  44. // }
  45. //
  46. // Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
  47. //
  48. // Timestamp start = ...;
  49. // Duration duration = ...;
  50. // Timestamp end = ...;
  51. //
  52. // end.seconds = start.seconds + duration.seconds;
  53. // end.nanos = start.nanos + duration.nanos;
  54. //
  55. // if (end.nanos < 0) {
  56. // end.seconds -= 1;
  57. // end.nanos += 1000000000;
  58. // } else if (end.nanos >= 1000000000) {
  59. // end.seconds += 1;
  60. // end.nanos -= 1000000000;
  61. // }
  62. //
  63. type Duration struct {
  64. // Signed seconds of the span of time. Must be from -315,576,000,000
  65. // to +315,576,000,000 inclusive.
  66. Seconds int64 `protobuf:"varint,1,opt,name=seconds" json:"seconds,omitempty"`
  67. // Signed fractions of a second at nanosecond resolution of the span
  68. // of time. Durations less than one second are represented with a 0
  69. // `seconds` field and a positive or negative `nanos` field. For durations
  70. // of one second or more, a non-zero value for the `nanos` field must be
  71. // of the same sign as the `seconds` field. Must be from -999,999,999
  72. // to +999,999,999 inclusive.
  73. Nanos int32 `protobuf:"varint,2,opt,name=nanos" json:"nanos,omitempty"`
  74. }
  75. func (m *Duration) Reset() { *m = Duration{} }
  76. func (m *Duration) String() string { return proto.CompactTextString(m) }
  77. func (*Duration) ProtoMessage() {}
  78. func (*Duration) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
  79. func (*Duration) XXX_WellKnownType() string { return "Duration" }
  80. func init() {
  81. proto.RegisterType((*Duration)(nil), "google.protobuf.Duration")
  82. }
  83. var fileDescriptor0 = []byte{
  84. // 187 bytes of a gzipped FileDescriptorProto
  85. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xb2, 0x4c, 0xcf, 0x2c, 0xc9,
  86. 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0x2f, 0x28,
  87. 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0x28, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x4f, 0x29,
  88. 0x2d, 0x4a, 0x2c, 0xc9, 0xcc, 0xcf, 0x83, 0x33, 0xf4, 0xc0, 0x2a, 0x84, 0xf8, 0xd3, 0xf3, 0xf3,
  89. 0xd3, 0x73, 0x52, 0xf5, 0x60, 0xea, 0x95, 0xac, 0xb8, 0x38, 0x5c, 0xa0, 0x4a, 0x84, 0x24, 0xb8,
  90. 0xd8, 0x8b, 0x53, 0x93, 0xf3, 0xf3, 0x52, 0x8a, 0x25, 0x18, 0x15, 0x18, 0x35, 0x98, 0x83, 0x60,
  91. 0x5c, 0x21, 0x11, 0x2e, 0xd6, 0xbc, 0xc4, 0xbc, 0xfc, 0x62, 0x09, 0x26, 0xa0, 0x38, 0x6b, 0x10,
  92. 0x84, 0xe3, 0x54, 0xc3, 0x25, 0x0c, 0x74, 0x82, 0x1e, 0x9a, 0x91, 0x4e, 0xbc, 0x30, 0x03, 0x03,
  93. 0x40, 0x22, 0x01, 0x8c, 0x51, 0x5a, 0xc4, 0xbb, 0x77, 0x01, 0x23, 0xe3, 0x22, 0x26, 0x66, 0xf7,
  94. 0x00, 0xa7, 0x55, 0x4c, 0x72, 0xee, 0x10, 0x73, 0x03, 0xa0, 0x4a, 0xf5, 0xc2, 0x53, 0x73, 0x72,
  95. 0xbc, 0xf3, 0xf2, 0xcb, 0xf3, 0x42, 0x40, 0x5a, 0x92, 0xd8, 0xc0, 0x66, 0x18, 0x03, 0x02, 0x00,
  96. 0x00, 0xff, 0xff, 0x62, 0xfb, 0xb1, 0x51, 0x0e, 0x01, 0x00, 0x00,
  97. }