generated.proto 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*
  2. Copyright The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. // This file was autogenerated by go-to-protobuf. Do not edit it manually!
  14. syntax = "proto2";
  15. package k8s.io.apimachinery.pkg.api.resource;
  16. // Package-wide variables from generator "generated".
  17. option go_package = "k8s.io/apimachinery/pkg/api/resource";
  18. // Quantity is a fixed-point representation of a number.
  19. // It provides convenient marshaling/unmarshaling in JSON and YAML,
  20. // in addition to String() and AsInt64() accessors.
  21. //
  22. // The serialization format is:
  23. //
  24. // ```
  25. // <quantity> ::= <signedNumber><suffix>
  26. //
  27. // (Note that <suffix> may be empty, from the "" case in <decimalSI>.)
  28. //
  29. // <digit> ::= 0 | 1 | ... | 9
  30. // <digits> ::= <digit> | <digit><digits>
  31. // <number> ::= <digits> | <digits>.<digits> | <digits>. | .<digits>
  32. // <sign> ::= "+" | "-"
  33. // <signedNumber> ::= <number> | <sign><number>
  34. // <suffix> ::= <binarySI> | <decimalExponent> | <decimalSI>
  35. // <binarySI> ::= Ki | Mi | Gi | Ti | Pi | Ei
  36. //
  37. // (International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)
  38. //
  39. // <decimalSI> ::= m | "" | k | M | G | T | P | E
  40. //
  41. // (Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)
  42. //
  43. // <decimalExponent> ::= "e" <signedNumber> | "E" <signedNumber>
  44. // ```
  45. //
  46. // No matter which of the three exponent forms is used, no quantity may represent
  47. // a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal
  48. // places. Numbers larger or more precise will be capped or rounded up.
  49. // (E.g.: 0.1m will rounded up to 1m.)
  50. // This may be extended in the future if we require larger or smaller quantities.
  51. //
  52. // When a Quantity is parsed from a string, it will remember the type of suffix
  53. // it had, and will use the same type again when it is serialized.
  54. //
  55. // Before serializing, Quantity will be put in "canonical form".
  56. // This means that Exponent/suffix will be adjusted up or down (with a
  57. // corresponding increase or decrease in Mantissa) such that:
  58. //
  59. // - No precision is lost
  60. // - No fractional digits will be emitted
  61. // - The exponent (or suffix) is as large as possible.
  62. //
  63. // The sign will be omitted unless the number is negative.
  64. //
  65. // Examples:
  66. //
  67. // - 1.5 will be serialized as "1500m"
  68. // - 1.5Gi will be serialized as "1536Mi"
  69. //
  70. // Note that the quantity will NEVER be internally represented by a
  71. // floating point number. That is the whole point of this exercise.
  72. //
  73. // Non-canonical values will still parse as long as they are well formed,
  74. // but will be re-emitted in their canonical form. (So always use canonical
  75. // form, or don't diff.)
  76. //
  77. // This format is intended to make it difficult to use these numbers without
  78. // writing some sort of special handling code in the hopes that that will
  79. // cause implementors to also use a fixed point implementation.
  80. //
  81. // +protobuf=true
  82. // +protobuf.embed=string
  83. // +protobuf.options.marshal=false
  84. // +protobuf.options.(gogoproto.goproto_stringer)=false
  85. // +k8s:deepcopy-gen=true
  86. // +k8s:openapi-gen=true
  87. message Quantity {
  88. optional string string = 1;
  89. }
  90. // QuantityValue makes it possible to use a Quantity as value for a command
  91. // line parameter.
  92. //
  93. // +protobuf=true
  94. // +protobuf.embed=string
  95. // +protobuf.options.marshal=false
  96. // +protobuf.options.(gogoproto.goproto_stringer)=false
  97. // +k8s:deepcopy-gen=true
  98. message QuantityValue {
  99. optional string string = 1;
  100. }