Simplify Codec and split responsibilities
Break Codec into two general purpose interfaces, Encoder and Decoder, and move parameter codec responsibilities to ParameterCodec. Make unversioned types explicit when registering - these types go through conversion without modification. Switch to use "__internal" instead of "" to represent the internal version. Future commits will also add group defaulting (so that "" is expanded internally into a known group version, and only cleared during set). For embedded types like runtime.Object -> runtime.RawExtension, put the responsibility on the caller of Decode/Encode to handle transformation into destination serialization. Future commits will expand RawExtension and Unknown to accept a content encoding as well as bytes. Make Unknown a bit more powerful and use it to carry unrecognized types.
This commit is contained in:
@@ -37,3 +37,11 @@ func IsMissingKind(err error) bool {
|
||||
func IsMissingVersion(err error) bool {
|
||||
return conversion.IsMissingVersion(err)
|
||||
}
|
||||
|
||||
func NewMissingKindErr(data string) error {
|
||||
return conversion.NewMissingKindErr(data)
|
||||
}
|
||||
|
||||
func NewMissingVersionErr(data string) error {
|
||||
return conversion.NewMissingVersionErr(data)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user