{"modulePath":"github.com/unitytech/client-go","version":"v2.0.0+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package runtime\n\nDefines conversions between generic types and structs to map query strings to struct objects.\n\n\tPackage runtime is a generated protocol buffer package.\n\n\tIt is generated from these files:\n\t\tk8s.io/kubernetes/pkg/runtime/generated.proto\n\n\tIt has these top-level messages:\n\t\tRawExtension\n\t\tTypeMeta\n\t\tUnknown\n\n## Constants\n\n```go\nconst (\n\t// APIVersionInternal may be used if you are registering a type that should not\n\t// be considered stable or serialized - it is a convention only and has no\n\t// special behavior in this package.\n\tAPIVersionInternal = \"__internal\"\n)\n```\n\n```go\nconst (\n\tContentTypeJSON string = \"application/json\"\n)\n```\n\n## Variables\n\n```go\nvar (\n\tErrInvalidLengthGenerated = fmt.Errorf(\"proto: negative length found during unmarshaling\")\n\tErrIntOverflowGenerated   = fmt.Errorf(\"proto: integer overflow\")\n)\n```\n\n```go\nvar DefaultFramer = defaultFramer{}\n```\nDefaultFramer is valid for any stream that can read objects serially without any separation in the stream.\n\n```go\nvar DefaultStringConversions = []interface{}{\n\tConvert_Slice_string_To_string,\n\tConvert_Slice_string_To_int,\n\tConvert_Slice_string_To_bool,\n\tConvert_Slice_string_To_int64,\n}\n```\nDefaultStringConversions are helpers for converting \\[]string and string to real values.\n\n## Functions\n\n```go\nfunc CheckCodec(c Codec, internalType Object, externalTypes ...unversioned.GroupVersionKind) error\n```\nCheckCodec makes sure that the codec can encode objects like internalType, decode all of the external types listed, and also decode them into the given object. (Will modify internalObject.) (Assumes JSON serialization.) TODO: verify that the correct external version is chosen on encode...\n\n```go\nfunc Convert_Slice_string_To_bool(input *[]string, out *bool, s conversion.Scope) error\n```\nConver\\_Slice\\_string\\_To\\_bool will convert a string parameter to boolean. Only the absence of a value, a value of \"false\", or a value of \"0\" resolve to false. Any other value (including empty string) resolves to true.\n\n```go\nfunc Convert_Slice_string_To_int(input *[]string, out *int, s conversion.Scope) error\n```\n\n```go\nfunc Convert_Slice_string_To_int64(input *[]string, out *int64, s conversion.Scope) error\n```\n\n```go\nfunc Convert_Slice_string_To_string(input *[]string, out *string, s conversion.Scope) error\n```\n\n```go\nfunc Convert_runtime_Object_To_runtime_RawExtension(in *Object, out *RawExtension, s conversion.Scope) error\n```\n\n```go\nfunc Convert_runtime_RawExtension_To_runtime_Object(in *RawExtension, out *Object, s conversion.Scope) error\n```\n\n```go\nfunc DecodeInto(d Decoder, data []byte, into Object) error\n```\nDecodeInto performs a Decode into the provided object.\n\n```go\nfunc DecodeList(objects []Object, decoders ...Decoder) []error\n```\nDecodeList alters the list in place, attempting to decode any objects found in the list that have the Unknown type. Any errors that occur are returned after the entire list is processed. Decoders are tried in order.\n\n```go\nfunc DeepCopy_runtime_RawExtension(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_runtime_TypeMeta(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_runtime_Unknown(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DefaultEmbeddedConversions() []interface{}\n```\n\n```go\nfunc Encode(e Encoder, obj Object) ([]byte, error)\n```\nEncode is a convenience wrapper for encoding to a \\[]byte from an Encoder\n\n```go\nfunc EncodeList(e Encoder, objects []Object) error\n```\nEncodeList ensures that each object in an array is converted to a Unknown{} in serialized form. TODO: accept a content type.\n\n```go\nfunc EncodeOrDie(e Encoder, obj Object) string\n```\nEncodeOrDie is a version of Encode which will panic instead of returning an error. For tests.\n\n```go\nfunc Field(v reflect.Value, fieldName string, dest interface{}) error\n```\nField puts the value of fieldName, which must be a member of v, into dest, which must be a variable to which this field's value can be assigned.\n\n```go\nfunc FieldPtr(v reflect.Value, fieldName string, dest interface{}) error\n```\nfieldPtr puts the address of fieldName, which must be a member of v, into dest, which must be an address of a variable to which this field's address can be assigned.\n\n```go\nfunc IsMissingKind(err error) bool\n```\nIsMissingKind returns true if the error indicates that the provided object is missing a 'Kind' field.\n\n```go\nfunc IsMissingVersion(err error) bool\n```\n\n```go\nfunc IsNotRegisteredError(err error) bool\n```\nIsNotRegisteredError returns true if the error indicates the provided object or input data is not registered.\n\n```go\nfunc JSONKeyMapper(key string, sourceTag, destTag reflect.StructTag) (string, string)\n```\nJSONKeyMapper uses the struct tags on a conversion to determine the key value for the other side. Use when mapping from a map\\[string]\\* to a struct or vice versa.\n\n```go\nfunc NewMissingKindErr(data string) error\n```\n\n```go\nfunc NewMissingVersionErr(data string) error\n```\nIsMissingVersion returns true if the error indicates that the provided object is missing a 'Version' field.\n\n```go\nfunc NewNotRegisteredErr(gvk unversioned.GroupVersionKind, t reflect.Type) error\n```\nNewNotRegisteredErr is exposed for testing.\n\n```go\nfunc SetField(src interface{}, v reflect.Value, fieldName string) error\n```\nSetField puts the value of src, into fieldName, which must be a member of v. The value of src must be assignable to the field.\n\n```go\nfunc SetZeroValue(objPtr Object) error\n```\nSetZeroValue would set the object of objPtr to zero value of its type.\n\n```go\nfunc VerifySwaggerDocsExist(kubeTypes []KubeTypes, w io.Writer) (int, error)\n```\nVerifySwaggerDocsExist writes in a io.Writer a list of structs and fields that are missing of documentation.\n\n```go\nfunc WriteSwaggerDocFunc(kubeTypes []KubeTypes, w io.Writer) error\n```\nWriteSwaggerDocFunc writes a declaration of a function as a string. This function is used in Swagger as a documentation source for structs and theirs fields\n\n## Types\n\n```go\ntype Codec Serializer\n```\nCodec is a Serializer that deals with the details of versioning objects. It offers the same interface as Serializer, so this is a marker to consumers that care about the version of the objects they receive.\n\n```go\nvar UnstructuredJSONScheme Codec = unstructuredJSONScheme{}\n```\nUnstructuredJSONScheme is capable of converting JSON data into the Unstructured type, which can be used for generic access to objects without a predefined scheme. TODO: move into serializer/json.\n\n```go\nfunc NewCodec(e Encoder, d Decoder) Codec\n```\nNewCodec creates a Codec from an Encoder and Decoder.\n\n```go\ntype Decoder interface {\n\t// Decode attempts to deserialize the provided data using either the innate typing of the scheme or the\n\t// default kind, group, and version provided. It returns a decoded object as well as the kind, group, and\n\t// version from the serialized data, or an error. If into is non-nil, it will be used as the target type\n\t// and implementations may choose to use it rather than reallocating an object. However, the object is not\n\t// guaranteed to be populated. The returned object is not guaranteed to match into. If defaults are\n\t// provided, they are applied to the data by default. If no defaults or partial defaults are provided, the\n\t// type of the into may be used to guide conversion decisions.\n\tDecode(data []byte, defaults *unversioned.GroupVersionKind, into Object) (Object, *unversioned.GroupVersionKind, error)\n}\n```\nDecoders attempt to load an object from data.\n\n```go\ntype DefaultingSerializer struct {\n\tDefaulter ObjectDefaulter\n\tDecoder   Decoder\n\t// Encoder is optional to allow this type to be used as both a Decoder and an Encoder\n\tEncoder\n}\n```\nDefaultingSerializer invokes defaulting after decoding.\n\n```go\nfunc (d DefaultingSerializer) Decode(data []byte, defaultGVK *unversioned.GroupVersionKind, into Object) (Object, *unversioned.GroupVersionKind, error)\n```\nDecode performs a decode and then allows the defaulter to act on the provided object.\n\n```go\ntype Encoder interface {\n\t// Encode writes an object to a stream. Implementations may return errors if the versions are\n\t// incompatible, or if no conversion is defined.\n\tEncode(obj Object, w io.Writer) error\n}\n```\nEncoders write objects to a serialized form\n\n```go\ntype FieldLabelConversionFunc func(label, value string) (internalLabel, internalValue string, err error)\n```\nFunction to convert a field selector to internal representation.\n\n```go\ntype Framer interface {\n\tNewFrameReader(r io.ReadCloser) io.ReadCloser\n\tNewFrameWriter(w io.Writer) io.Writer\n}\n```\nFramer is a factory for creating readers and writers that obey a particular framing pattern.\n\n```go\ntype GroupVersioner interface {\n\t// KindForGroupVersionKinds returns a desired target group version kind for the given input, or returns ok false if no\n\t// target is known. In general, if the return target is not in the input list, the caller is expected to invoke\n\t// Scheme.New(target) and then perform a conversion between the current Go type and the destination Go type.\n\t// Sophisticated implementations may use additional information about the input kinds to pick a destination kind.\n\tKindForGroupVersionKinds(kinds []unversioned.GroupVersionKind) (target unversioned.GroupVersionKind, ok bool)\n}\n```\nGroupVersioner refines a set of possible conversion targets into a single option.\n\n```go\nvar (\n\t// InternalGroupVersioner will always prefer the internal version for a given group version kind.\n\tInternalGroupVersioner GroupVersioner = internalGroupVersioner{}\n\t// DisabledGroupVersioner will reject all kinds passed to it.\n\tDisabledGroupVersioner GroupVersioner = disabledGroupVersioner{}\n)\n```\n\n```go\nfunc NewMultiGroupVersioner(gv unversioned.GroupVersion, groupKinds ...unversioned.GroupKind) GroupVersioner\n```\nNewMultiGroupVersioner returns the provided group version for any kind that matches one of the provided group kinds. Kind may be empty in the provided group kind, in which case any kind will match.\n\n```go\ntype GroupVersioners []GroupVersioner\n```\nGroupVersioners implements GroupVersioner and resolves to the first exact match for any kind.\n\n```go\nfunc (gvs GroupVersioners) KindForGroupVersionKinds(kinds []unversioned.GroupVersionKind) (unversioned.GroupVersionKind, bool)\n```\nKindForGroupVersionKinds returns the first match of any of the group versioners, or false if no match occured.\n\n```go\ntype KubeTypes []Pair\n```\nKubeTypes is an array to represent all available types in a parsed file. \\[0] is for the type itself\n\n```go\nfunc ParseDocumentationFrom(src string) []KubeTypes\n```\nParseDocumentationFrom gets all types' documentation and returns them as an array. Each type is again represented as an array (we have to use arrays as we need to be sure for the order of the fields). This function returns fields and struct definitions that have no documentation as {name, \"\"}.\n\n```go\ntype MultiObjectTyper []ObjectTyper\n```\nMultiObjectTyper returns the types of objects across multiple schemes in order.\n\n```go\nfunc (m MultiObjectTyper) ObjectKinds(obj Object) (gvks []unversioned.GroupVersionKind, unversionedType bool, err error)\n```\n\n```go\nfunc (m MultiObjectTyper) Recognizes(gvk unversioned.GroupVersionKind) bool\n```\n\n```go\ntype NegotiatedSerializer interface {\n\t// SupportedMediaTypes is the media types supported for reading and writing single objects.\n\tSupportedMediaTypes() []SerializerInfo\n\n\t// EncoderForVersion returns an encoder that ensures objects being written to the provided\n\t// serializer are in the provided group version.\n\tEncoderForVersion(serializer Encoder, gv GroupVersioner) Encoder\n\t// DecoderForVersion returns a decoder that ensures objects being read by the provided\n\t// serializer are in the provided group version by default.\n\tDecoderToVersion(serializer Decoder, gv GroupVersioner) Decoder\n}\n```\nNegotiatedSerializer is an interface used for obtaining encoders, decoders, and serializers for multiple supported media types. This would commonly be accepted by a server component that performs HTTP content negotiation to accept multiple formats.\n\n```go\ntype NestedObjectDecoder interface {\n\tDecodeNestedObjects(d Decoder) error\n}\n```\nNestedObjectDecoder is an optional interface that objects may implement to be given an opportunity to decode any nested Objects / RawExtensions during serialization.\n\n```go\ntype NestedObjectEncoder interface {\n\tEncodeNestedObjects(e Encoder) error\n}\n```\nNestedObjectEncoder is an optional interface that objects may implement to be given an opportunity to encode any nested Objects / RawExtensions during serialization.\n\n```go\ntype NoopDecoder struct {\n\tEncoder\n}\n```\nNoopDecoder converts an Encoder to a Serializer or Codec for code that expects them but only uses encoding.\n\n```go\nfunc (n NoopDecoder) Decode(data []byte, gvk *unversioned.GroupVersionKind, into Object) (Object, *unversioned.GroupVersionKind, error)\n```\n\n```go\ntype NoopEncoder struct {\n\tDecoder\n}\n```\nNoopEncoder converts an Decoder to a Serializer or Codec for code that expects them but only uses decoding.\n\n```go\nfunc (n NoopEncoder) Encode(obj Object, w io.Writer) error\n```\n\n```go\ntype Object interface {\n\tGetObjectKind() unversioned.ObjectKind\n}\n```\nAll API types registered with Scheme must support the Object interface. Since objects in a scheme are expected to be serialized to the wire, the interface an Object must provide to the Scheme allows serializers to set the kind, version, and group the object is represented as. An Object may choose to return a no-op ObjectKindAccessor in cases where it is not expected to be serialized.\n\n```go\nfunc Decode(d Decoder, data []byte) (Object, error)\n```\nDecode is a convenience wrapper for decoding data into an Object.\n\n```go\nfunc NewEncodable(e Encoder, obj Object, versions ...unversioned.GroupVersion) Object\n```\nNewEncodable creates an object that will be encoded with the provided codec on demand. Provided as a convenience for test cases dealing with internal objects.\n\n```go\nfunc NewEncodableList(e Encoder, objects []Object, versions ...unversioned.GroupVersion) []Object\n```\nNewEncodableList creates an object that will be encoded with the provided codec on demand. Provided as a convenience for test cases dealing with internal objects.\n\n```go\nfunc UseOrCreateObject(t ObjectTyper, c ObjectCreater, gvk unversioned.GroupVersionKind, obj Object) (Object, error)\n```\nUseOrCreateObject returns obj if the canonical ObjectKind returned by the provided typer matches gvk, or invokes the ObjectCreator to instantiate a new gvk. Returns an error if the typer cannot find the object.\n\n```go\ntype ObjectConvertor interface {\n\t// Convert attempts to convert one object into another, or returns an error. This method does\n\t// not guarantee the in object is not mutated. The context argument will be passed to\n\t// all nested conversions.\n\tConvert(in, out, context interface{}) error\n\t// ConvertToVersion takes the provided object and converts it the provided version. This\n\t// method does not guarantee that the in object is not mutated. This method is similar to\n\t// Convert() but handles specific details of choosing the correct output version.\n\tConvertToVersion(in Object, gv GroupVersioner) (out Object, err error)\n\tConvertFieldLabel(version, kind, label, value string) (string, string, error)\n}\n```\nObjectConvertor converts an object to a different version.\n\n```go\nfunc UnsafeObjectConvertor(scheme *Scheme) ObjectConvertor\n```\nUnsafeObjectConvertor performs object conversion without copying the object structure, for use when the converted object will not be reused or mutated. Primarily for use within versioned codecs, which use the external object for serialization but do not return it.\n\n```go\ntype ObjectCopier interface {\n\t// Copy returns an exact copy of the provided Object, or an error if the\n\t// copy could not be completed.\n\tCopy(Object) (Object, error)\n}\n```\nObjectCopier duplicates an object.\n\n```go\ntype ObjectCreater interface {\n\tNew(kind unversioned.GroupVersionKind) (out Object, err error)\n}\n```\nObjectCreater contains methods for instantiating an object by kind and version.\n\n```go\ntype ObjectDefaulter interface {\n\t// Default takes an object (must be a pointer) and applies any default values.\n\t// Defaulters may not error.\n\tDefault(in Object)\n}\n```\n\n```go\ntype ObjectTyper interface {\n\t// ObjectKinds returns the all possible group,version,kind of the provided object, true if\n\t// the object is unversioned, or an error if the object is not recognized\n\t// (IsNotRegisteredError will return true).\n\tObjectKinds(Object) ([]unversioned.GroupVersionKind, bool, error)\n\t// Recognizes returns true if the scheme is able to handle the provided version and kind,\n\t// or more precisely that the provided version is a possible conversion or decoding\n\t// target.\n\tRecognizes(gvk unversioned.GroupVersionKind) bool\n}\n```\nObjectTyper contains methods for extracting the APIVersion and Kind of objects.\n\n```go\ntype ObjectVersioner interface {\n\tConvertToVersion(in Object, gv GroupVersioner) (out Object, err error)\n}\n```\n\n```go\ntype Pair struct {\n\tName, Doc string\n}\n```\nPair of strings. We keed the name of fields and the doc\n\n```go\ntype ParameterCodec interface {\n\t// DecodeParameters takes the given url.Values in the specified group version and decodes them\n\t// into the provided object, or returns an error.\n\tDecodeParameters(parameters url.Values, from unversioned.GroupVersion, into Object) error\n\t// EncodeParameters encodes the provided object as query parameters or returns an error.\n\tEncodeParameters(obj Object, to unversioned.GroupVersion) (url.Values, error)\n}\n```\nParameterCodec defines methods for serializing and deserializing API objects to url.Values and performing any necessary conversion. Unlike the normal Codec, query parameters are not self describing and the desired version must be specified.\n\n```go\nfunc NewParameterCodec(scheme *Scheme) ParameterCodec\n```\nNewParameterCodec creates a ParameterCodec capable of transforming url values into versioned objects and back.\n\n```go\ntype ProtobufMarshaller interface {\n\tMarshalTo(data []byte) (int, error)\n}\n```\n\n```go\ntype RawExtension struct {\n\t// Raw is the underlying serialization of this object.\n\t//\n\t// TODO: Determine how to detect ContentType and ContentEncoding of 'Raw' data.\n\tRaw []byte `protobuf:\"bytes,1,opt,name=raw\"`\n\t// Object can hold a representation of this extension - useful for working with versioned\n\t// structs.\n\tObject Object `json:\"-\"`\n}\n```\nRawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.Object `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// External package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// On the wire, the JSON will look something like this:\n\n\t{\n\t\t\"kind\":\"MyAPIObject\",\n\t\t\"apiVersion\":\"v1\",\n\t\t\"myPlugin\": {\n\t\t\t\"kind\":\"PluginA\",\n\t\t\t\"aOption\":\"foo\",\n\t\t},\n\t}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)\n\n\\+k8s:deepcopy-gen=true +protobuf=true +k8s:openapi-gen=true\n\n```go\nfunc (*RawExtension) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (m *RawExtension) Marshal() (data []byte, err error)\n```\n\n```go\nfunc (re RawExtension) MarshalJSON() ([]byte, error)\n```\nMarshal may get called on pointers or values, so implement MarshalJSON on value. [http://stackoverflow.com/questions/21390979/custom-marshaljson-never-gets-called-in-go](http://stackoverflow.com/questions/21390979/custom-marshaljson-never-gets-called-in-go)\n\n```go\nfunc (m *RawExtension) MarshalTo(data []byte) (int, error)\n```\n\n```go\nfunc (*RawExtension) ProtoMessage()\n```\n\n```go\nfunc (m *RawExtension) Reset()\n```\n\n```go\nfunc (m *RawExtension) Size() (n int)\n```\n\n```go\nfunc (this *RawExtension) String() string\n```\n\n```go\nfunc (m *RawExtension) Unmarshal(data []byte) error\n```\n\n```go\nfunc (re *RawExtension) UnmarshalJSON(in []byte) error\n```\n\n```go\ntype ResourceVersioner interface {\n\tSetResourceVersion(obj Object, version string) error\n\tResourceVersion(obj Object) (string, error)\n}\n```\nResourceVersioner provides methods for setting and retrieving the resource version from an API object.\n\n```go\ntype Scheme struct {\n\t// contains filtered or unexported fields\n}\n```\nScheme defines methods for serializing and deserializing API objects, a type registry for converting group, version, and kind information to and from Go schemas, and mappings between Go schemas of different versions. A scheme is the foundation for a versioned API and versioned configuration over time.\n\nIn a Scheme, a Type is a particular Go struct, a Version is a point-in-time identifier for a particular representation of that Type (typically backwards compatible), a Kind is the unique name for that Type within the Version, and a Group identifies a set of Versions, Kinds, and Types that evolve over time. An Unversioned Type is one that is not yet formally bound to a type and is promised to be backwards compatible (effectively a \"v1\" of a Type that does not expect to break in the future).\n\nSchemes are not expected to change at runtime and are only threadsafe after registration is complete.\n\n```go\nfunc NewScheme() *Scheme\n```\nNewScheme creates a new Scheme. This scheme is pluggable by default.\n\n```go\nfunc (s *Scheme) AddConversionFuncs(conversionFuncs ...interface{}) error\n```\nAddConversionFuncs adds functions to the list of conversion functions. The given functions should know how to convert between two of your API objects, or their sub-objects. We deduce how to call these functions from the types of their two parameters; see the comment for Converter.Register.\n\nNote that, if you need to copy sub-objects that didn't change, you can use the conversion.Scope object that will be passed to your conversion function. Additionally, all conversions started by Scheme will set the SrcVersion and DestVersion fields on the Meta object. Example:\n\ns.AddConversionFuncs(\n\n\tfunc(in *InternalObject, out *ExternalObject, scope conversion.Scope) error {\n\t\t// You can depend on Meta() being non-nil, and this being set to\n\t\t// the source version, e.g., \"\"\n\t\ts.Meta().SrcVersion\n\t\t// You can depend on this being set to the destination version,\n\t\t// e.g., \"v1\".\n\t\ts.Meta().DestVersion\n\t\t// Call scope.Convert to copy sub-fields.\n\t\ts.Convert(\u0026in.SubFieldThatMoved, \u0026out.NewLocation.NewName, 0)\n\t\treturn nil\n\t},\n\n)\n\n(For more detail about conversion functions, see Converter.Register's comment.)\n\nAlso note that the default behavior, if you don't add a conversion function, is to sanely copy fields that have the same names and same type names. It's OK if the destination type has extra fields, but it must not remove any. So you only need to add conversion functions for things with changed/removed fields.\n\n```go\nfunc (s *Scheme) AddDeepCopyFuncs(deepCopyFuncs ...interface{}) error\n```\nAddDeepCopyFuncs adds a function to the list of deep-copy functions. For the expected format of deep-copy function, see the comment for Copier.RegisterDeepCopyFunction.\n\n```go\nfunc (s *Scheme) AddDefaultingFuncs(defaultingFuncs ...interface{}) error\n```\nAddDefaultingFuncs adds functions to the list of default-value functions. Each of the given functions is responsible for applying default values when converting an instance of a versioned API object into an internal API object.  These functions do not need to handle sub-objects. We deduce how to call these functions from the types of their two parameters.\n\ns.AddDefaultingFuncs(\n\n\tfunc(obj *v1.Pod) {\n\t\tif obj.OptionalField == \"\" {\n\t\t\tobj.OptionalField = \"DefaultValue\"\n\t\t}\n\t},\n\n)\n\n```go\nfunc (s *Scheme) AddFieldLabelConversionFunc(version, kind string, conversionFunc FieldLabelConversionFunc) error\n```\nAddFieldLabelConversionFunc adds a conversion function to convert field selectors of the given kind from the given version to internal version representation.\n\n```go\nfunc (s *Scheme) AddGeneratedConversionFuncs(conversionFuncs ...interface{}) error\n```\nSimilar to AddConversionFuncs, but registers conversion functions that were automatically generated.\n\n```go\nfunc (s *Scheme) AddGeneratedDeepCopyFuncs(deepCopyFuncs ...conversion.GeneratedDeepCopyFunc) error\n```\nSimilar to AddDeepCopyFuncs, but registers deep-copy functions that were automatically generated.\n\n```go\nfunc (s *Scheme) AddGenericConversionFunc(fn conversion.GenericConversionFunc)\n```\nAddGenericConversionFunc adds a function that accepts the ConversionFunc call pattern (for two conversion types) to the converter. These functions are checked first during a normal conversion, but are otherwise not called. Use AddConversionFuncs when registering typed conversions.\n\n```go\nfunc (s *Scheme) AddIgnoredConversionType(from, to interface{}) error\n```\nAddIgnoredConversionType identifies a pair of types that should be skipped by conversion (because the data inside them is explicitly dropped during conversion).\n\n```go\nfunc (s *Scheme) AddKnownTypeWithName(gvk unversioned.GroupVersionKind, obj Object)\n```\nAddKnownTypeWithName is like AddKnownTypes, but it lets you specify what this type should be encoded as. Useful for testing when you don't want to make multiple packages to define your structs. Version may not be empty - use the APIVersionInternal constant if you have a type that does not have a formal version.\n\n```go\nfunc (s *Scheme) AddKnownTypes(gv unversioned.GroupVersion, types ...Object)\n```\nAddKnownTypes registers all types passed in 'types' as being members of version 'version'. All objects passed to types should be pointers to structs. The name that go reports for the struct becomes the \"kind\" field when encoding. Version may not be empty - use the APIVersionInternal constant if you have a type that does not have a formal version.\n\n```go\nfunc (s *Scheme) AddStructFieldConversion(srcFieldType interface{}, srcFieldName string, destFieldType interface{}, destFieldName string) error\n```\nAddStructFieldConversion allows you to specify a mechanical copy for a moved or renamed struct field without writing an entire conversion function. See the comment in conversion.Converter.SetStructFieldCopy for parameter details. Call as many times as needed, even on the same fields.\n\n```go\nfunc (s *Scheme) AddTypeDefaultingFunc(srcType Object, fn func(interface{}))\n```\nAddTypeDefaultingFuncs registers a function that is passed a pointer to an object and can default fields on the object. These functions will be invoked when Default() is called. The function will never be called unless the defaulted object matches srcType. If this function is invoked twice with the same srcType, the fn passed to the later call will be used instead.\n\n```go\nfunc (s *Scheme) AddUnversionedTypes(version unversioned.GroupVersion, types ...Object)\n```\nAddUnversionedTypes registers the provided types as \"unversioned\", which means that they follow special rules. Whenever an object of this type is serialized, it is serialized with the provided group version and is not converted. Thus unversioned objects are expected to remain backwards compatible forever, as if they were in an API group and version that would never be updated.\n\nTODO: there is discussion about removing unversioned and replacing it with objects that are manifest into\n\n\tevery version with particular schemas. Resolve this method at that point.\n\n```go\nfunc (s *Scheme) AllKnownTypes() map[unversioned.GroupVersionKind]reflect.Type\n```\nAllKnownTypes returns the all known types.\n\n```go\nfunc (s *Scheme) Convert(in, out interface{}, context interface{}) error\n```\nConvert will attempt to convert in into out. Both must be pointers. For easy testing of conversion functions. Returns an error if the conversion isn't possible. You can call this with types that haven't been registered (for example, a to test conversion of types that are nested within registered types). The context interface is passed to the convertor. TODO: identify whether context should be hidden, or behind a formal context/scope\n\n\tinterface\n\n```go\nfunc (s *Scheme) ConvertFieldLabel(version, kind, label, value string) (string, string, error)\n```\nConverts the given field label and value for an kind field selector from versioned representation to an unversioned one.\n\n```go\nfunc (s *Scheme) ConvertToVersion(in Object, target GroupVersioner) (Object, error)\n```\nConvertToVersion attempts to convert an input object to its matching Kind in another version within this scheme. Will return an error if the provided version does not contain the inKind (or a mapping by name defined with AddKnownTypeWithName). Will also return an error if the conversion does not result in a valid Object being returned. Passes target down to the conversion methods as the Context on the scope.\n\n```go\nfunc (s *Scheme) Converter() *conversion.Converter\n```\nConverter allows access to the converter for the scheme\n\n```go\nfunc (s *Scheme) Copy(src Object) (Object, error)\n```\nCopy does a deep copy of an API object.\n\n```go\nfunc (s *Scheme) DeepCopy(src interface{}) (interface{}, error)\n```\nPerforms a deep copy of the given object.\n\n```go\nfunc (s *Scheme) Default(src Object)\n```\nDefault sets defaults on the provided Object.\n\n```go\nfunc (s *Scheme) IsUnversioned(obj Object) (bool, bool)\n```\n\n```go\nfunc (s *Scheme) KnownTypes(gv unversioned.GroupVersion) map[string]reflect.Type\n```\nKnownTypes returns the types known for the given version.\n\n```go\nfunc (s *Scheme) Log(l conversion.DebugLogger)\n```\nLog sets a logger on the scheme. For test purposes only\n\n```go\nfunc (s *Scheme) New(kind unversioned.GroupVersionKind) (Object, error)\n```\nNew returns a new API object of the given version and name, or an error if it hasn't been registered. The version and kind fields must be specified.\n\n```go\nfunc (s *Scheme) ObjectKind(obj Object) (unversioned.GroupVersionKind, bool, error)\n```\nObjectKind returns the group,version,kind of the go object and true if this object is considered unversioned, or an error if it's not a pointer or is unregistered.\n\n```go\nfunc (s *Scheme) ObjectKinds(obj Object) ([]unversioned.GroupVersionKind, bool, error)\n```\nObjectKinds returns all possible group,version,kind of the go object, true if the object is considered unversioned, or an error if it's not a pointer or is unregistered.\n\n```go\nfunc (s *Scheme) Recognizes(gvk unversioned.GroupVersionKind) bool\n```\nRecognizes returns true if the scheme is able to handle the provided group,version,kind of an object.\n\n```go\nfunc (s *Scheme) RegisterInputDefaults(in interface{}, fn conversion.FieldMappingFunc, defaultFlags conversion.FieldMatchingFlags) error\n```\nRegisterInputDefaults sets the provided field mapping function and field matching as the defaults for the provided input type.  The fn may be nil, in which case no mapping will happen by default. Use this method to register a mechanism for handling a specific input type in conversion, such as a map\\[string]string to structs.\n\n```go\nfunc (s *Scheme) UnsafeConvertToVersion(in Object, target GroupVersioner) (Object, error)\n```\nUnsafeConvertToVersion will convert in to the provided target if such a conversion is possible, but does not guarantee the output object does not share fields with the input object. It attempts to be as efficient as possible when doing conversion.\n\n```go\ntype SchemeBuilder []func(*Scheme) error\n```\nSchemeBuilder collects functions that add things to a scheme. It's to allow code to compile without explicitly referencing generated types. You should declare one in each package that will have generated deep copy or conversion functions.\n\n```go\nfunc NewSchemeBuilder(funcs ...func(*Scheme) error) SchemeBuilder\n```\nNewSchemeBuilder calls Register for you.\n\n```go\nfunc (sb *SchemeBuilder) AddToScheme(s *Scheme) error\n```\nAddToScheme applies all the stored functions to the scheme. A non-nil error indicates that one function failed and the attempt was abandoned.\n\n```go\nfunc (sb *SchemeBuilder) Register(funcs ...func(*Scheme) error)\n```\nRegister adds a scheme setup function to the list.\n\n```go\ntype SelfLinker interface {\n\tSetSelfLink(obj Object, selfLink string) error\n\tSelfLink(obj Object) (string, error)\n\n\t// Knowing Name is sometimes necessary to use a SelfLinker.\n\tName(obj Object) (string, error)\n\t// Knowing Namespace is sometimes necessary to use a SelfLinker\n\tNamespace(obj Object) (string, error)\n}\n```\nSelfLinker provides methods for setting and retrieving the SelfLink field of an API object.\n\n```go\ntype Serializer interface {\n\tEncoder\n\tDecoder\n}\n```\nSerializer is the core interface for transforming objects into a serialized format and back. Implementations may choose to perform conversion of the object, but no assumptions should be made.\n\n```go\nfunc NewBase64Serializer(s Serializer) Serializer\n```\n\n```go\ntype SerializerInfo struct {\n\t// MediaType is the value that represents this serializer over the wire.\n\tMediaType string\n\t// EncodesAsText indicates this serializer can be encoded to UTF-8 safely.\n\tEncodesAsText bool\n\t// Serializer is the individual object serializer for this media type.\n\tSerializer Serializer\n\t// PrettySerializer, if set, can serialize this object in a form biased towards\n\t// readability.\n\tPrettySerializer Serializer\n\t// StreamSerializer, if set, describes the streaming serialization format\n\t// for this media type.\n\tStreamSerializer *StreamSerializerInfo\n}\n```\nSerializerInfo contains information about a specific serialization format\n\n```go\nfunc SerializerInfoForMediaType(types []SerializerInfo, mediaType string) (SerializerInfo, bool)\n```\nSerializerInfoForMediaType returns the first info in types that has a matching media type (which cannot include media-type parameters), or the first info with an empty media type, or false if no type matches.\n\n```go\ntype StorageSerializer interface {\n\t// SupportedMediaTypes are the media types supported for reading and writing objects.\n\tSupportedMediaTypes() []SerializerInfo\n\n\t// UniversalDeserializer returns a Serializer that can read objects in multiple supported formats\n\t// by introspecting the data at rest.\n\tUniversalDeserializer() Decoder\n\n\t// EncoderForVersion returns an encoder that ensures objects being written to the provided\n\t// serializer are in the provided group version.\n\tEncoderForVersion(serializer Encoder, gv GroupVersioner) Encoder\n\t// DecoderForVersion returns a decoder that ensures objects being read by the provided\n\t// serializer are in the provided group version by default.\n\tDecoderToVersion(serializer Decoder, gv GroupVersioner) Decoder\n}\n```\nStorageSerializer is an interface used for obtaining encoders, decoders, and serializers that can read and write data at rest. This would commonly be used by client tools that must read files, or server side storage interfaces that persist restful objects.\n\n```go\ntype StreamSerializerInfo struct {\n\t// EncodesAsText indicates this serializer can be encoded to UTF-8 safely.\n\tEncodesAsText bool\n\t// Serializer is the top level object serializer for this type when streaming\n\tSerializer\n\t// Framer is the factory for retrieving streams that separate objects on the wire\n\tFramer\n}\n```\nStreamSerializerInfo contains information about a specific stream serialization format\n\n```go\ntype TypeMeta struct {\n\t// +optional\n\tAPIVersion string `json:\"apiVersion,omitempty\" yaml:\"apiVersion,omitempty\" protobuf:\"bytes,1,opt,name=apiVersion\"`\n\t// +optional\n\tKind string `json:\"kind,omitempty\" yaml:\"kind,omitempty\" protobuf:\"bytes,2,opt,name=kind\"`\n}\n```\nTypeMeta is shared by all top level objects. The proper way to use it is to inline it in your type, like this:\n\n\ttype MyAwesomeAPIObject struct {\n\t     runtime.TypeMeta    `json:\",inline\"`\n\t     ... // other fields\n\t}\n\nfunc (obj \\*MyAwesomeAPIObject) SetGroupVersionKind(gvk \\*unversioned.GroupVersionKind) { unversioned.UpdateTypeMeta(obj,gvk) }; GroupVersionKind() \\*GroupVersionKind\n\nTypeMeta is provided here for convenience. You may use it directly from this package or define your own with the same fields.\n\n\\+k8s:deepcopy-gen=true +protobuf=true +k8s:openapi-gen=true\n\n```go\nfunc (*TypeMeta) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (obj *TypeMeta) GroupVersionKind() unversioned.GroupVersionKind\n```\nGroupVersionKind satisfies the ObjectKind interface for all objects that embed TypeMeta\n\n```go\nfunc (m *TypeMeta) Marshal() (data []byte, err error)\n```\n\n```go\nfunc (m *TypeMeta) MarshalTo(data []byte) (int, error)\n```\n\n```go\nfunc (*TypeMeta) ProtoMessage()\n```\n\n```go\nfunc (m *TypeMeta) Reset()\n```\n\n```go\nfunc (obj *TypeMeta) SetGroupVersionKind(gvk unversioned.GroupVersionKind)\n```\nSetGroupVersionKind satisfies the ObjectKind interface for all objects that embed TypeMeta\n\n```go\nfunc (m *TypeMeta) Size() (n int)\n```\n\n```go\nfunc (this *TypeMeta) String() string\n```\n\n```go\nfunc (m *TypeMeta) Unmarshal(data []byte) error\n```\n\n```go\ntype Unknown struct {\n\tTypeMeta `json:\",inline\" protobuf:\"bytes,1,opt,name=typeMeta\"`\n\t// Raw will hold the complete serialized object which couldn't be matched\n\t// with a registered type. Most likely, nothing should be done with this\n\t// except for passing it through the system.\n\tRaw []byte `protobuf:\"bytes,2,opt,name=raw\"`\n\t// ContentEncoding is encoding used to encode 'Raw' data.\n\t// Unspecified means no encoding.\n\tContentEncoding string `protobuf:\"bytes,3,opt,name=contentEncoding\"`\n\t// ContentType  is serialization method used to serialize 'Raw'.\n\t// Unspecified means ContentTypeJSON.\n\tContentType string `protobuf:\"bytes,4,opt,name=contentType\"`\n}\n```\nUnknown allows api objects with unknown types to be passed-through. This can be used to deal with the API objects from a plug-in. Unknown objects still have functioning TypeMeta features-- kind, version, etc. TODO: Make this object have easy access to field based accessors and settors for metadata and field mutatation.\n\n\\+k8s:deepcopy-gen=true +protobuf=true +k8s:openapi-gen=true\n\n```go\nfunc (*Unknown) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (obj *Unknown) GetObjectKind() unversioned.ObjectKind\n```\n\n```go\nfunc (m *Unknown) Marshal() (data []byte, err error)\n```\n\n```go\nfunc (re Unknown) MarshalJSON() ([]byte, error)\n```\nMarshal may get called on pointers or values, so implement MarshalJSON on value. [http://stackoverflow.com/questions/21390979/custom-marshaljson-never-gets-called-in-go](http://stackoverflow.com/questions/21390979/custom-marshaljson-never-gets-called-in-go)\n\n```go\nfunc (m *Unknown) MarshalTo(data []byte) (int, error)\n```\n\n```go\nfunc (m *Unknown) NestedMarshalTo(data []byte, b ProtobufMarshaller, size uint64) (int, error)\n```\nNestedMarshalTo allows a caller to avoid extra allocations during serialization of an Unknown that will contain an object that implements ProtobufMarshaller.\n\n```go\nfunc (*Unknown) ProtoMessage()\n```\n\n```go\nfunc (m *Unknown) Reset()\n```\n\n```go\nfunc (m *Unknown) Size() (n int)\n```\n\n```go\nfunc (this *Unknown) String() string\n```\n\n```go\nfunc (m *Unknown) Unmarshal(data []byte) error\n```\n\n```go\nfunc (re *Unknown) UnmarshalJSON(in []byte) error\n```\n\n```go\ntype Unstructured struct {\n\t// Object is a JSON compatible map with string, float, int, []interface{}, or map[string]interface{}\n\t// children.\n\tObject map[string]interface{}\n}\n```\nUnstructured allows objects that do not have Golang structs registered to be manipulated generically. This can be used to deal with the API objects from a plug-in. Unstructured objects still have functioning TypeMeta features-- kind, version, etc. TODO: Make this object have easy access to field based accessors and settors for metadata and field mutatation.\n\n```go\nfunc (u *Unstructured) GetAPIVersion() string\n```\n\n```go\nfunc (u *Unstructured) GetAnnotations() map[string]string\n```\n\n```go\nfunc (u *Unstructured) GetClusterName() string\n```\n\n```go\nfunc (u *Unstructured) GetCreationTimestamp() unversioned.Time\n```\n\n```go\nfunc (u *Unstructured) GetDeletionTimestamp() *unversioned.Time\n```\n\n```go\nfunc (u *Unstructured) GetFinalizers() []string\n```\n\n```go\nfunc (u *Unstructured) GetGenerateName() string\n```\n\n```go\nfunc (u *Unstructured) GetKind() string\n```\n\n```go\nfunc (u *Unstructured) GetLabels() map[string]string\n```\n\n```go\nfunc (u *Unstructured) GetName() string\n```\n\n```go\nfunc (u *Unstructured) GetNamespace() string\n```\n\n```go\nfunc (obj *Unstructured) GetObjectKind() unversioned.ObjectKind\n```\n\n```go\nfunc (u *Unstructured) GetOwnerReferences() []metatypes.OwnerReference\n```\n\n```go\nfunc (u *Unstructured) GetResourceVersion() string\n```\n\n```go\nfunc (u *Unstructured) GetSelfLink() string\n```\n\n```go\nfunc (u *Unstructured) GetUID() types.UID\n```\n\n```go\nfunc (u *Unstructured) GroupVersionKind() unversioned.GroupVersionKind\n```\n\n```go\nfunc (u *Unstructured) MarshalJSON() ([]byte, error)\n```\nMarshalJSON ensures that the unstructured object produces proper JSON when passed to Go's standard JSON library.\n\n```go\nfunc (u *Unstructured) SetAPIVersion(version string)\n```\n\n```go\nfunc (u *Unstructured) SetAnnotations(annotations map[string]string)\n```\n\n```go\nfunc (u *Unstructured) SetClusterName(clusterName string)\n```\n\n```go\nfunc (u *Unstructured) SetCreationTimestamp(timestamp unversioned.Time)\n```\n\n```go\nfunc (u *Unstructured) SetDeletionTimestamp(timestamp *unversioned.Time)\n```\n\n```go\nfunc (u *Unstructured) SetFinalizers(finalizers []string)\n```\n\n```go\nfunc (u *Unstructured) SetGenerateName(name string)\n```\n\n```go\nfunc (u *Unstructured) SetGroupVersionKind(gvk unversioned.GroupVersionKind)\n```\n\n```go\nfunc (u *Unstructured) SetKind(kind string)\n```\n\n```go\nfunc (u *Unstructured) SetLabels(labels map[string]string)\n```\n\n```go\nfunc (u *Unstructured) SetName(name string)\n```\n\n```go\nfunc (u *Unstructured) SetNamespace(namespace string)\n```\n\n```go\nfunc (u *Unstructured) SetOwnerReferences(references []metatypes.OwnerReference)\n```\n\n```go\nfunc (u *Unstructured) SetResourceVersion(version string)\n```\n\n```go\nfunc (u *Unstructured) SetSelfLink(selfLink string)\n```\n\n```go\nfunc (u *Unstructured) SetUID(uid types.UID)\n```\n\n```go\nfunc (u *Unstructured) UnmarshalJSON(b []byte) error\n```\nUnmarshalJSON ensures that the unstructured object properly decodes JSON when passed to Go's standard JSON library.\n\n```go\ntype UnstructuredList struct {\n\tObject map[string]interface{}\n\n\t// Items is a list of unstructured objects.\n\tItems []*Unstructured `json:\"items\"`\n}\n```\nUnstructuredList allows lists that do not have Golang structs registered to be manipulated generically. This can be used to deal with the API lists from a plug-in.\n\n```go\nfunc (u *UnstructuredList) GetAPIVersion() string\n```\n\n```go\nfunc (u *UnstructuredList) GetKind() string\n```\n\n```go\nfunc (obj *UnstructuredList) GetObjectKind() unversioned.ObjectKind\n```\n\n```go\nfunc (u *UnstructuredList) GetResourceVersion() string\n```\n\n```go\nfunc (u *UnstructuredList) GetSelfLink() string\n```\n\n```go\nfunc (u *UnstructuredList) GroupVersionKind() unversioned.GroupVersionKind\n```\n\n```go\nfunc (u *UnstructuredList) MarshalJSON() ([]byte, error)\n```\nMarshalJSON ensures that the unstructured list object produces proper JSON when passed to Go's standard JSON library.\n\n```go\nfunc (u *UnstructuredList) SetAPIVersion(version string)\n```\n\n```go\nfunc (u *UnstructuredList) SetGroupVersionKind(gvk unversioned.GroupVersionKind)\n```\n\n```go\nfunc (u *UnstructuredList) SetKind(kind string)\n```\n\n```go\nfunc (u *UnstructuredList) SetResourceVersion(version string)\n```\n\n```go\nfunc (u *UnstructuredList) SetSelfLink(selfLink string)\n```\n\n```go\nfunc (u *UnstructuredList) UnmarshalJSON(b []byte) error\n```\nUnmarshalJSON ensures that the unstructured list object properly decodes JSON when passed to Go's standard JSON library.\n\n```go\ntype UnstructuredObjectConverter struct{}\n```\nUnstructuredObjectConverter is an ObjectConverter for use with Unstructured objects. Since it has no schema or type information, it will only succeed for no-op conversions. This is provided as a sane implementation for APIs that require an object converter.\n\n```go\nfunc (UnstructuredObjectConverter) Convert(in, out, context interface{}) error\n```\n\n```go\nfunc (UnstructuredObjectConverter) ConvertFieldLabel(version, kind, label, value string) (string, string, error)\n```\n\n```go\nfunc (UnstructuredObjectConverter) ConvertToVersion(in Object, target GroupVersioner) (Object, error)\n```\n\n```go\ntype VersionedObjects struct {\n\t// Objects is the set of objects retrieved during decoding, in order of conversion.\n\t// The 0 index is the object as serialized on the wire. If conversion has occurred,\n\t// other objects may be present. The right most object is the same as would be returned\n\t// by a normal Decode call.\n\tObjects []Object\n}\n```\nVersionedObjects is used by Decoders to give callers a way to access all versions of an object during the decoding process.\n\n```go\nfunc (obj *VersionedObjects) First() Object\n```\nFirst returns the leftmost object in the VersionedObjects array, which is usually the object as serialized on the wire.\n\n```go\nfunc (obj *VersionedObjects) GetObjectKind() unversioned.ObjectKind\n```\nGetObjectKind implements Object for VersionedObjects, returning an empty ObjectKind interface if no objects are provided, or the ObjectKind interface of the object in the highest array position.\n\n```go\nfunc (obj *VersionedObjects) Last() Object\n```\nLast is the rightmost object in the VersionedObjects array, which is the object after all transformations have been applied. This is the same object that would be returned by Decode in a normal invocation (without VersionedObjects in the into argument).\n\n","path":"github.com/unitytech/client-go/pkg/runtime","name":"runtime","synopsis":"Defines conversions between generic types and structs to map query strings to struct objects.","isRedistributable":true}
