type codec … // NewCodec creates a Codec from an Encoder and Decoder. func NewCodec(e Encoder, d Decoder) Codec { … } // Encode is a convenience wrapper for encoding to a []byte from an Encoder func Encode(e Encoder, obj Object) ([]byte, error) { … } // Decode is a convenience wrapper for decoding data into an Object. func Decode(d Decoder, data []byte) (Object, error) { … } // DecodeInto performs a Decode into the provided object. func DecodeInto(d Decoder, data []byte, into Object) error { … } // EncodeOrDie is a version of Encode which will panic instead of returning an error. For tests. func EncodeOrDie(e Encoder, obj Object) string { … } // UseOrCreateObject 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. func UseOrCreateObject(t ObjectTyper, c ObjectCreater, gvk schema.GroupVersionKind, obj Object) (Object, error) { … } type NoopEncoder … var _ … const noopEncoderIdentifier … func (n NoopEncoder) Encode(obj Object, w io.Writer) error { … } // Identifier implements runtime.Encoder interface. func (n NoopEncoder) Identifier() Identifier { … } type NoopDecoder … var _ … func (n NoopDecoder) Decode(data []byte, gvk *schema.GroupVersionKind, into Object) (Object, *schema.GroupVersionKind, error) { … } // NewParameterCodec creates a ParameterCodec capable of transforming url values into versioned objects and back. func NewParameterCodec(scheme *Scheme) ParameterCodec { … } type parameterCodec … var _ … // DecodeParameters converts the provided url.Values into an object of type From with the kind of into, and then // converts that object to into (if necessary). Returns an error if the operation cannot be completed. func (c *parameterCodec) DecodeParameters(parameters url.Values, from schema.GroupVersion, into Object) error { … } // EncodeParameters converts the provided object into the to version, then converts that object to url.Values. // Returns an error if conversion is not possible. func (c *parameterCodec) EncodeParameters(obj Object, to schema.GroupVersion) (url.Values, error) { … } type base64Serializer … func NewBase64Serializer(e Encoder, d Decoder) Serializer { … } func identifier(e Encoder) Identifier { … } func (s base64Serializer) Encode(obj Object, stream io.Writer) error { … } func (s base64Serializer) doEncode(obj Object, stream io.Writer) error { … } // Identifier implements runtime.Encoder interface. func (s base64Serializer) Identifier() Identifier { … } func (s base64Serializer) Decode(data []byte, defaults *schema.GroupVersionKind, into Object) (Object, *schema.GroupVersionKind, error) { … } // SerializerInfoForMediaType 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. func SerializerInfoForMediaType(types []SerializerInfo, mediaType string) (SerializerInfo, bool) { … } var InternalGroupVersioner … var DisabledGroupVersioner … const internalGroupVersionerIdentifier … const disabledGroupVersionerIdentifier … type internalGroupVersioner … // KindForGroupVersionKinds returns an internal Kind if one is found, or converts the first provided kind to the internal version. func (internalGroupVersioner) KindForGroupVersionKinds(kinds []schema.GroupVersionKind) (schema.GroupVersionKind, bool) { … } // Identifier implements GroupVersioner interface. func (internalGroupVersioner) Identifier() string { … } type disabledGroupVersioner … // KindForGroupVersionKinds returns false for any input. func (disabledGroupVersioner) KindForGroupVersionKinds(kinds []schema.GroupVersionKind) (schema.GroupVersionKind, bool) { … } // Identifier implements GroupVersioner interface. func (disabledGroupVersioner) Identifier() string { … } var _ … var _ … var _ … type multiGroupVersioner … // NewMultiGroupVersioner 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. func NewMultiGroupVersioner(gv schema.GroupVersion, groupKinds ...schema.GroupKind) GroupVersioner { … } // NewCoercingMultiGroupVersioner returns the provided group version for any incoming kind. // Incoming kinds that match the provided groupKinds are preferred. // Kind may be empty in the provided group kind, in which case any kind will match. // Examples: // // gv=mygroup/__internal, groupKinds=mygroup/Foo, anothergroup/Bar // KindForGroupVersionKinds(yetanother/v1/Baz, anothergroup/v1/Bar) -> mygroup/__internal/Bar (matched preferred group/kind) // // gv=mygroup/__internal, groupKinds=mygroup, anothergroup // KindForGroupVersionKinds(yetanother/v1/Baz, anothergroup/v1/Bar) -> mygroup/__internal/Bar (matched preferred group) // // gv=mygroup/__internal, groupKinds=mygroup, anothergroup // KindForGroupVersionKinds(yetanother/v1/Baz, yetanother/v1/Bar) -> mygroup/__internal/Baz (no preferred group/kind match, uses first kind in list) func NewCoercingMultiGroupVersioner(gv schema.GroupVersion, groupKinds ...schema.GroupKind) GroupVersioner { … } // KindForGroupVersionKinds returns the target group version if any kind matches any of the original group kinds. It will // use the originating kind where possible. func (v multiGroupVersioner) KindForGroupVersionKinds(kinds []schema.GroupVersionKind) (schema.GroupVersionKind, bool) { … } // Identifier implements GroupVersioner interface. func (v multiGroupVersioner) Identifier() string { … }