generated.proto 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 = "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 Int64() accessors.
  21. //
  22. // The serialization format is:
  23. //
  24. // <quantity> ::= <signedNumber><suffix>
  25. // (Note that <suffix> may be empty, from the "" case in <decimalSI>.)
  26. // <digit> ::= 0 | 1 | ... | 9
  27. // <digits> ::= <digit> | <digit><digits>
  28. // <number> ::= <digits> | <digits>.<digits> | <digits>. | .<digits>
  29. // <sign> ::= "+" | "-"
  30. // <signedNumber> ::= <number> | <sign><number>
  31. // <suffix> ::= <binarySI> | <decimalExponent> | <decimalSI>
  32. // <binarySI> ::= Ki | Mi | Gi | Ti | Pi | Ei
  33. // (International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)
  34. // <decimalSI> ::= m | "" | k | M | G | T | P | E
  35. // (Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)
  36. // <decimalExponent> ::= "e" <signedNumber> | "E" <signedNumber>
  37. //
  38. // No matter which of the three exponent forms is used, no quantity may represent
  39. // a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal
  40. // places. Numbers larger or more precise will be capped or rounded up.
  41. // (E.g.: 0.1m will rounded up to 1m.)
  42. // This may be extended in the future if we require larger or smaller quantities.
  43. //
  44. // When a Quantity is parsed from a string, it will remember the type of suffix
  45. // it had, and will use the same type again when it is serialized.
  46. //
  47. // Before serializing, Quantity will be put in "canonical form".
  48. // This means that Exponent/suffix will be adjusted up or down (with a
  49. // corresponding increase or decrease in Mantissa) such that:
  50. // a. No precision is lost
  51. // b. No fractional digits will be emitted
  52. // c. The exponent (or suffix) is as large as possible.
  53. // The sign will be omitted unless the number is negative.
  54. //
  55. // Examples:
  56. // 1.5 will be serialized as "1500m"
  57. // 1.5Gi will be serialized as "1536Mi"
  58. //
  59. // Note that the quantity will NEVER be internally represented by a
  60. // floating point number. That is the whole point of this exercise.
  61. //
  62. // Non-canonical values will still parse as long as they are well formed,
  63. // but will be re-emitted in their canonical form. (So always use canonical
  64. // form, or don't diff.)
  65. //
  66. // This format is intended to make it difficult to use these numbers without
  67. // writing some sort of special handling code in the hopes that that will
  68. // cause implementors to also use a fixed point implementation.
  69. //
  70. // +protobuf=true
  71. // +protobuf.embed=string
  72. // +protobuf.options.marshal=false
  73. // +protobuf.options.(gogoproto.goproto_stringer)=false
  74. // +k8s:deepcopy-gen=true
  75. // +k8s:openapi-gen=true
  76. message Quantity {
  77. optional string string = 1;
  78. }