1 /* 2 Copyright 2017 The Kubernetes Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package scheme 18 19 import ( 20 "k8s.io/apimachinery/pkg/runtime" 21 "k8s.io/apimachinery/pkg/runtime/serializer" 22 utilruntime "k8s.io/apimachinery/pkg/util/runtime" 23 "k8s.io/kubernetes/pkg/proxy/apis/config" 24 "k8s.io/kubernetes/pkg/proxy/apis/config/v1alpha1" 25 ) 26 27 var ( 28 // Scheme defines methods for serializing and deserializing API objects. 29 Scheme = runtime.NewScheme() 30 // Codecs provides methods for retrieving codecs and serializers for specific 31 // versions and content types. 32 Codecs = serializer.NewCodecFactory(Scheme, serializer.EnableStrict) 33 ) 34 35 func init() { 36 AddToScheme(Scheme) 37 } 38 39 // AddToScheme adds the types of this group into the given scheme. 40 func AddToScheme(scheme *runtime.Scheme) { 41 utilruntime.Must(v1alpha1.AddToScheme(scheme)) 42 utilruntime.Must(config.AddToScheme(scheme)) 43 } 44