Documentation ¶
Index ¶
- Constants
- Variables
- func Convert(codecs serializer.CodecFactory, inMediaType, outMediaType string, in []byte) ([]byte, *runtime.TypeMeta, error)
- func DecodeSummary(inMediaType string, in []byte, out io.Writer) error
- func DecodeTypeMeta(inMediaType string, in []byte) (*runtime.TypeMeta, error)
- func DecodeUnknown(in []byte) (*runtime.Unknown, error)
- func DetectAndConvert(codecs serializer.CodecFactory, outMediaType string, in []byte) ([]byte, *runtime.TypeMeta, error)
- func DetectAndExtract(in []byte) (string, []byte, error)
- func ToMediaType(out string) (string, error)
Constants ¶
const ( StorageBinaryMediaType = "application/vnd.kubernetes.storagebinary" ProtobufMediaType = "application/vnd.kubernetes.protobuf" YamlMediaType = "application/yaml" JsonMediaType = "application/json" ProtobufShortname = "proto" YamlShortname = "yaml" JsonShortname = "json" )
Variables ¶
var ProtoEncodingPrefix = []byte{0x6b, 0x38, 0x73, 0x00}
See k8s.io/apimachinery/pkg/runtime/serializer/protobuf.go
Functions ¶
func Convert ¶
func Convert(codecs serializer.CodecFactory, inMediaType, outMediaType string, in []byte) ([]byte, *runtime.TypeMeta, error)
Convert from kv store encoded data to the given output format using kubernetes' api machinery to perform the conversion.
func DecodeSummary ¶
DecodeSummary decodes the TypeMeta, ContentEncoding and ContentType fields from the 'Unknown' protobuf envelope of the given storage data.
func DecodeTypeMeta ¶
DecodeTypeMeta gets the TypeMeta from the given data, either as JSON or Protobuf.
func DecodeUnknown ¶
DecodeUnknown decodes the Unknown protobuf type from the given storage data.
func DetectAndConvert ¶
func DetectAndConvert(codecs serializer.CodecFactory, outMediaType string, in []byte) ([]byte, *runtime.TypeMeta, error)
DetectAndConvert first detects the media type of the in param data and then converts it from the kv store encoded data to the given output format using kubernetes' api machinery to perform the conversion.
func DetectAndExtract ¶
DetectAndExtract searches the the start of either json of protobuf data, and, if found, returns the mime type and data.
func ToMediaType ¶
ToMediaType maps 'out' flag values to corresponding mime types.
Types ¶
This section is empty.