コード例 #1
0
ファイル: negotiate.go プロジェクト: 40a/bootkube
func negotiateOutputStreamSerializer(req *http.Request, ns runtime.NegotiatedSerializer) (runtime.StreamSerializerInfo, error) {
	supported := ns.SupportedMediaTypes()
	mediaType, params, err := negotiateOutput(req, supported)
	if err != nil {
		return runtime.StreamSerializerInfo{}, err
	}
	if s, ok := ns.StreamingSerializerForMediaType(mediaType, params); ok {
		return s, nil
	}
	return runtime.StreamSerializerInfo{}, errNotAcceptable{supported}
}
コード例 #2
0
ファイル: negotiate.go プロジェクト: Clarifai/kubernetes
func negotiateOutputStreamSerializer(req *http.Request, ns runtime.NegotiatedSerializer) (runtime.Serializer, runtime.Framer, string, string, error) {
	supported := ns.SupportedMediaTypes()
	mediaType, params, err := negotiateOutput(req, supported)
	if err != nil {
		return nil, nil, "", "", err
	}
	if s, f, exactMediaType, ok := ns.StreamingSerializerForMediaType(mediaType, params); ok {
		return s, f, mediaType, exactMediaType, nil
	}
	return nil, nil, "", "", errNotAcceptable{supported}
}