github.com/timstclair/heapster@v0.20.0-alpha1/Godeps/_workspace/src/k8s.io/kubernetes/pkg/api/v1/register.go (about) 1 /* 2 Copyright 2015 The Kubernetes Authors All rights reserved. 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 v1 18 19 import ( 20 "k8s.io/kubernetes/pkg/api" 21 "k8s.io/kubernetes/pkg/api/registered" 22 "k8s.io/kubernetes/pkg/api/unversioned" 23 "k8s.io/kubernetes/pkg/runtime" 24 ) 25 26 // Codec encodes internal objects to the v1 scheme 27 var Codec = runtime.CodecFor(api.Scheme, "v1") 28 29 func init() { 30 // Check if v1 is in the list of supported API versions. 31 if !registered.IsRegisteredAPIGroupVersion(unversioned.GroupVersion{Group: "", Version: "v1"}) { 32 return 33 } 34 35 // Register the API. 36 addKnownTypes() 37 addConversionFuncs() 38 addDefaultingFuncs() 39 } 40 41 // Adds the list of known types to api.Scheme. 42 func addKnownTypes() { 43 api.Scheme.AddKnownTypes("v1", 44 &Pod{}, 45 &PodList{}, 46 &PodStatusResult{}, 47 &PodTemplate{}, 48 &PodTemplateList{}, 49 &ReplicationController{}, 50 &ReplicationControllerList{}, 51 &Service{}, 52 &ServiceList{}, 53 &Endpoints{}, 54 &EndpointsList{}, 55 &Node{}, 56 &NodeList{}, 57 &Binding{}, 58 &Event{}, 59 &EventList{}, 60 &List{}, 61 &LimitRange{}, 62 &LimitRangeList{}, 63 &ResourceQuota{}, 64 &ResourceQuotaList{}, 65 &Namespace{}, 66 &NamespaceList{}, 67 &Secret{}, 68 &SecretList{}, 69 &ServiceAccount{}, 70 &ServiceAccountList{}, 71 &PersistentVolume{}, 72 &PersistentVolumeList{}, 73 &PersistentVolumeClaim{}, 74 &PersistentVolumeClaimList{}, 75 &DeleteOptions{}, 76 &ListOptions{}, 77 &PodAttachOptions{}, 78 &PodLogOptions{}, 79 &PodExecOptions{}, 80 &PodProxyOptions{}, 81 &ComponentStatus{}, 82 &ComponentStatusList{}, 83 &SerializedReference{}, 84 &RangeAllocation{}, 85 ) 86 87 // Add common types 88 api.Scheme.AddKnownTypes("v1", &unversioned.Status{}) 89 } 90 91 func (*Pod) IsAnAPIObject() {} 92 func (*PodList) IsAnAPIObject() {} 93 func (*PodStatusResult) IsAnAPIObject() {} 94 func (*PodTemplate) IsAnAPIObject() {} 95 func (*PodTemplateList) IsAnAPIObject() {} 96 func (*ReplicationController) IsAnAPIObject() {} 97 func (*ReplicationControllerList) IsAnAPIObject() {} 98 func (*Service) IsAnAPIObject() {} 99 func (*ServiceList) IsAnAPIObject() {} 100 func (*Endpoints) IsAnAPIObject() {} 101 func (*EndpointsList) IsAnAPIObject() {} 102 func (*Node) IsAnAPIObject() {} 103 func (*NodeList) IsAnAPIObject() {} 104 func (*Binding) IsAnAPIObject() {} 105 func (*Event) IsAnAPIObject() {} 106 func (*EventList) IsAnAPIObject() {} 107 func (*List) IsAnAPIObject() {} 108 func (*LimitRange) IsAnAPIObject() {} 109 func (*LimitRangeList) IsAnAPIObject() {} 110 func (*ResourceQuota) IsAnAPIObject() {} 111 func (*ResourceQuotaList) IsAnAPIObject() {} 112 func (*Namespace) IsAnAPIObject() {} 113 func (*NamespaceList) IsAnAPIObject() {} 114 func (*Secret) IsAnAPIObject() {} 115 func (*SecretList) IsAnAPIObject() {} 116 func (*ServiceAccount) IsAnAPIObject() {} 117 func (*ServiceAccountList) IsAnAPIObject() {} 118 func (*PersistentVolume) IsAnAPIObject() {} 119 func (*PersistentVolumeList) IsAnAPIObject() {} 120 func (*PersistentVolumeClaim) IsAnAPIObject() {} 121 func (*PersistentVolumeClaimList) IsAnAPIObject() {} 122 func (*DeleteOptions) IsAnAPIObject() {} 123 func (*ListOptions) IsAnAPIObject() {} 124 func (*PodAttachOptions) IsAnAPIObject() {} 125 func (*PodLogOptions) IsAnAPIObject() {} 126 func (*PodExecOptions) IsAnAPIObject() {} 127 func (*PodProxyOptions) IsAnAPIObject() {} 128 func (*ComponentStatus) IsAnAPIObject() {} 129 func (*ComponentStatusList) IsAnAPIObject() {} 130 func (*SerializedReference) IsAnAPIObject() {} 131 func (*RangeAllocation) IsAnAPIObject() {}