-
Notifications
You must be signed in to change notification settings - Fork 541
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use runtime.SerializerInfo in place of internal "serializerType".
CodecFactory construction uses an unexported struct type named "serializerType" to hold serializer definitions. There are few differences between it and runtime.SerializerInfo, and they do not appear to be used anymore. For example, serializerType includes an unused FileExtensions field, and has distinct ContentType (singular) and AcceptContentTypes (plural) fields instead of runtime.SerializeInfo's singular MediaType. All remaining uses of serializerType set AcceptContentTypes to a single-entry slice whose element is equal to its ContentType field. During construction of a CodecFactory, all serializerType values were already being mechanically translated into runtime.SerializerInfo values. Moving to an exported type for serializer definitions makes it easier to expose an option to allow callers to register their own serializer definitions, which in turn makes it possible to conditionally include new serializers at runtime (especially behind feature gates). Kubernetes-commit: 66a14268c591a30090de4f89185b8d880ddbdf18
- Loading branch information
1 parent
cfee475
commit 009e863
Showing
1 changed file
with
46 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters