Documentation ¶
Index ¶
- Constants
- Variables
- func AddToScheme(scheme *runtime.Scheme)
- func Convert(inMediaType, outMediaType string, in []byte, out io.Writer) (*runtime.TypeMeta, error)
- func DecodeRaw(in []byte, out io.Writer) error
- func DecodeSummary(inMediaType string, in []byte, out io.Writer) error
- func DecodeUnknown(in []byte) (*runtime.Unknown, error)
- func DetectAndConvert(outMediaType string, in []byte, out io.Writer) (*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 Codecs = serializer.NewCodecFactory(Scheme)
var IsGet bool
var ParameterCodec = runtime.NewParameterCodec(Scheme)
var ProtoEncodingPrefix = []byte{0x6b, 0x38, 0x73, 0x00}
See k8s.io/apimachinery/pkg/runtime/serializer/protobuf.go
var Scheme = runtime.NewScheme()
Functions ¶
func AddToScheme ¶
AddToScheme adds all types of this clientset into the given scheme. This allows composition of clientsets, like in:
import ( "k8s.io/client-go/kubernetes" clientsetscheme "k8s.io/client-go/kuberentes/scheme" aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" ) kclientset, _ := kubernetes.NewForConfig(c) aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
After this, RawExtensions in Kubernetes types will serialize kube-aggregator types correctly.
func Convert ¶
Convert from kv store encoded data to the given output format using kubernetes' api machinery to perform the conversion.
func DecodeRaw ¶
DecodeRaw decodes the raw payload bytes contained within the 'Unknown' protobuf envelope of the given storage data.
func DecodeSummary ¶
DecodeSummary decodes the TypeMeta, ContentEncoding and ContentType fields from the 'Unknown' protobuf envelope of the given storage data.
func DecodeUnknown ¶
DecodeUnknown decodes the Unknown protobuf type from the given storage data.
func DetectAndConvert ¶
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.