doc.go 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. Copyright 2014 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. // Package runtime includes helper functions for working with API objects
  14. // that follow the kubernetes API object conventions, which are:
  15. //
  16. // 0. Your API objects have a common metadata struct member, TypeMeta.
  17. //
  18. // 1. Your code refers to an internal set of API objects.
  19. //
  20. // 2. In a separate package, you have an external set of API objects.
  21. //
  22. // 3. The external set is considered to be versioned, and no breaking
  23. // changes are ever made to it (fields may be added but not changed
  24. // or removed).
  25. //
  26. // 4. As your api evolves, you'll make an additional versioned package
  27. // with every major change.
  28. //
  29. // 5. Versioned packages have conversion functions which convert to
  30. // and from the internal version.
  31. //
  32. // 6. You'll continue to support older versions according to your
  33. // deprecation policy, and you can easily provide a program/library
  34. // to update old versions into new versions because of 5.
  35. //
  36. // 7. All of your serializations and deserializations are handled in a
  37. // centralized place.
  38. //
  39. // Package runtime provides a conversion helper to make 5 easy, and the
  40. // Encode/Decode/DecodeInto trio to accomplish 7. You can also register
  41. // additional "codecs" which use a version of your choice. It's
  42. // recommended that you register your types with runtime in your
  43. // package's init function.
  44. //
  45. // As a bonus, a few common types useful from all api objects and versions
  46. // are provided in types.go.
  47. package runtime // import "k8s.io/apimachinery/pkg/runtime"