generated.proto 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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.runtime;
  16. // Package-wide variables from generator "generated".
  17. option go_package = "runtime";
  18. // RawExtension is used to hold extensions in external versions.
  19. //
  20. // To use this, make a field which has RawExtension as its type in your external, versioned
  21. // struct, and Object in your internal struct. You also need to register your
  22. // various plugin types.
  23. //
  24. // // Internal package:
  25. // type MyAPIObject struct {
  26. // runtime.TypeMeta `json:",inline"`
  27. // MyPlugin runtime.Object `json:"myPlugin"`
  28. // }
  29. // type PluginA struct {
  30. // AOption string `json:"aOption"`
  31. // }
  32. //
  33. // // External package:
  34. // type MyAPIObject struct {
  35. // runtime.TypeMeta `json:",inline"`
  36. // MyPlugin runtime.RawExtension `json:"myPlugin"`
  37. // }
  38. // type PluginA struct {
  39. // AOption string `json:"aOption"`
  40. // }
  41. //
  42. // // On the wire, the JSON will look something like this:
  43. // {
  44. // "kind":"MyAPIObject",
  45. // "apiVersion":"v1",
  46. // "myPlugin": {
  47. // "kind":"PluginA",
  48. // "aOption":"foo",
  49. // },
  50. // }
  51. //
  52. // So what happens? Decode first uses json or yaml to unmarshal the serialized data into
  53. // your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked.
  54. // The next step is to copy (using pkg/conversion) into the internal struct. The runtime
  55. // package's DefaultScheme has conversion functions installed which will unpack the
  56. // JSON stored in RawExtension, turning it into the correct object type, and storing it
  57. // in the Object. (TODO: In the case where the object is of an unknown type, a
  58. // runtime.Unknown object will be created and stored.)
  59. //
  60. // +k8s:deepcopy-gen=true
  61. // +protobuf=true
  62. // +k8s:openapi-gen=true
  63. message RawExtension {
  64. // Raw is the underlying serialization of this object.
  65. //
  66. // TODO: Determine how to detect ContentType and ContentEncoding of 'Raw' data.
  67. optional bytes raw = 1;
  68. }
  69. // TypeMeta is shared by all top level objects. The proper way to use it is to inline it in your type,
  70. // like this:
  71. // type MyAwesomeAPIObject struct {
  72. // runtime.TypeMeta `json:",inline"`
  73. // ... // other fields
  74. // }
  75. // func (obj *MyAwesomeAPIObject) SetGroupVersionKind(gvk *metav1.GroupVersionKind) { metav1.UpdateTypeMeta(obj,gvk) }; GroupVersionKind() *GroupVersionKind
  76. //
  77. // TypeMeta is provided here for convenience. You may use it directly from this package or define
  78. // your own with the same fields.
  79. //
  80. // +k8s:deepcopy-gen=false
  81. // +protobuf=true
  82. // +k8s:openapi-gen=true
  83. message TypeMeta {
  84. // +optional
  85. optional string apiVersion = 1;
  86. // +optional
  87. optional string kind = 2;
  88. }
  89. // Unknown allows api objects with unknown types to be passed-through. This can be used
  90. // to deal with the API objects from a plug-in. Unknown objects still have functioning
  91. // TypeMeta features-- kind, version, etc.
  92. // TODO: Make this object have easy access to field based accessors and settors for
  93. // metadata and field mutatation.
  94. //
  95. // +k8s:deepcopy-gen=true
  96. // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
  97. // +protobuf=true
  98. // +k8s:openapi-gen=true
  99. message Unknown {
  100. optional TypeMeta typeMeta = 1;
  101. // Raw will hold the complete serialized object which couldn't be matched
  102. // with a registered type. Most likely, nothing should be done with this
  103. // except for passing it through the system.
  104. optional bytes raw = 2;
  105. // ContentEncoding is encoding used to encode 'Raw' data.
  106. // Unspecified means no encoding.
  107. optional string contentEncoding = 3;
  108. // ContentType is serialization method used to serialize 'Raw'.
  109. // Unspecified means ContentTypeJSON.
  110. optional string contentType = 4;
  111. }