当前位置: 首页>>代码示例>>Golang>>正文


Golang Cloner.DeepCopy方法代码示例

本文整理汇总了Golang中k8s/io/kubernetes/pkg/conversion.Cloner.DeepCopy方法的典型用法代码示例。如果您正苦于以下问题:Golang Cloner.DeepCopy方法的具体用法?Golang Cloner.DeepCopy怎么用?Golang Cloner.DeepCopy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在k8s/io/kubernetes/pkg/conversion.Cloner的用法示例。


在下文中一共展示了Cloner.DeepCopy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: DeepCopy_api_ResourceAccessReviewResponse

func DeepCopy_api_ResourceAccessReviewResponse(in ResourceAccessReviewResponse, out *ResourceAccessReviewResponse, c *conversion.Cloner) error {
	if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
		return err
	}
	out.Namespace = in.Namespace
	if in.Users != nil {
		in, out := in.Users, &out.Users
		*out = make(sets.String)
		for key, val := range in {
			if newVal, err := c.DeepCopy(val); err != nil {
				return err
			} else {
				(*out)[key] = newVal.(sets.Empty)
			}
		}
	} else {
		out.Users = nil
	}
	if in.Groups != nil {
		in, out := in.Groups, &out.Groups
		*out = make(sets.String)
		for key, val := range in {
			if newVal, err := c.DeepCopy(val); err != nil {
				return err
			} else {
				(*out)[key] = newVal.(sets.Empty)
			}
		}
	} else {
		out.Groups = nil
	}
	out.EvaluationError = in.EvaluationError
	return nil
}
开发者ID:Xmagicer,项目名称:origin,代码行数:34,代码来源:deep_copy_generated.go

示例2: DeepCopy_v1beta1_UserInfo

func DeepCopy_v1beta1_UserInfo(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*UserInfo)
		out := out.(*UserInfo)
		out.Username = in.Username
		out.UID = in.UID
		if in.Groups != nil {
			in, out := &in.Groups, &out.Groups
			*out = make([]string, len(*in))
			copy(*out, *in)
		} else {
			out.Groups = nil
		}
		if in.Extra != nil {
			in, out := &in.Extra, &out.Extra
			*out = make(map[string]ExtraValue)
			for key, val := range *in {
				if newVal, err := c.DeepCopy(&val); err != nil {
					return err
				} else {
					(*out)[key] = *newVal.(*ExtraValue)
				}
			}
		} else {
			out.Extra = nil
		}
		return nil
	}
}
开发者ID:stensonb,项目名称:kubernetes,代码行数:29,代码来源:zz_generated.deepcopy.go

示例3: DeepCopy_api_Policy

func DeepCopy_api_Policy(in Policy, out *Policy, c *conversion.Cloner) error {
	if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
		return err
	}
	if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
		return err
	}
	if err := unversioned.DeepCopy_unversioned_Time(in.LastModified, &out.LastModified, c); err != nil {
		return err
	}
	if in.Roles != nil {
		in, out := in.Roles, &out.Roles
		*out = make(map[string]*Role)
		for key, val := range in {
			if newVal, err := c.DeepCopy(val); err != nil {
				return err
			} else {
				(*out)[key] = newVal.(*Role)
			}
		}
	} else {
		out.Roles = nil
	}
	return nil
}
开发者ID:ZenoRewn,项目名称:origin,代码行数:25,代码来源:deep_copy_generated.go

示例4: DeepCopy_api_SubjectAccessReview

func DeepCopy_api_SubjectAccessReview(in SubjectAccessReview, out *SubjectAccessReview, c *conversion.Cloner) error {
	if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
		return err
	}
	if err := DeepCopy_api_Action(in.Action, &out.Action, c); err != nil {
		return err
	}
	out.User = in.User
	if in.Groups != nil {
		in, out := in.Groups, &out.Groups
		*out = make(sets.String)
		for key, val := range in {
			if newVal, err := c.DeepCopy(val); err != nil {
				return err
			} else {
				(*out)[key] = newVal.(sets.Empty)
			}
		}
	} else {
		out.Groups = nil
	}
	if in.Scopes != nil {
		in, out := in.Scopes, &out.Scopes
		*out = make([]string, len(in))
		copy(*out, in)
	} else {
		out.Scopes = nil
	}
	return nil
}
开发者ID:Xmagicer,项目名称:origin,代码行数:30,代码来源:deep_copy_generated.go

示例5: DeepCopy_api_ClusterPolicyBinding

func DeepCopy_api_ClusterPolicyBinding(in ClusterPolicyBinding, out *ClusterPolicyBinding, c *conversion.Cloner) error {
	if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
		return err
	}
	if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
		return err
	}
	if err := unversioned.DeepCopy_unversioned_Time(in.LastModified, &out.LastModified, c); err != nil {
		return err
	}
	if err := api.DeepCopy_api_ObjectReference(in.PolicyRef, &out.PolicyRef, c); err != nil {
		return err
	}
	if in.RoleBindings != nil {
		in, out := in.RoleBindings, &out.RoleBindings
		*out = make(map[string]*ClusterRoleBinding)
		for key, val := range in {
			if newVal, err := c.DeepCopy(val); err != nil {
				return err
			} else {
				(*out)[key] = newVal.(*ClusterRoleBinding)
			}
		}
	} else {
		out.RoleBindings = nil
	}
	return nil
}
开发者ID:ZenoRewn,项目名称:origin,代码行数:28,代码来源:deep_copy_generated.go

示例6: DeepCopy_v1beta1_UserInfo

func DeepCopy_v1beta1_UserInfo(in UserInfo, out *UserInfo, c *conversion.Cloner) error {
	out.Username = in.Username
	out.UID = in.UID
	if in.Groups != nil {
		in, out := in.Groups, &out.Groups
		*out = make([]string, len(in))
		copy(*out, in)
	} else {
		out.Groups = nil
	}
	if in.Extra != nil {
		in, out := in.Extra, &out.Extra
		*out = make(map[string][]string)
		for key, val := range in {
			if newVal, err := c.DeepCopy(val); err != nil {
				return err
			} else {
				(*out)[key] = newVal.([]string)
			}
		}
	} else {
		out.Extra = nil
	}
	return nil
}
开发者ID:apcera,项目名称:kubernetes,代码行数:25,代码来源:deep_copy_generated.go

示例7: DeepCopy_api_ResourceQuotasStatusByNamespace

func DeepCopy_api_ResourceQuotasStatusByNamespace(in ResourceQuotasStatusByNamespace, out *ResourceQuotasStatusByNamespace, c *conversion.Cloner) error {
	if newVal, err := c.DeepCopy(in.orderedMap); err != nil {
		return err
	} else {
		out.orderedMap = newVal.(orderedMap)
	}
	return nil
}
开发者ID:Xmagicer,项目名称:origin,代码行数:8,代码来源:deep_copy_generated.go

示例8: deepCopy_unversioned_Time

func deepCopy_unversioned_Time(in unversioned.Time, out *unversioned.Time, c *conversion.Cloner) error {
	if newVal, err := c.DeepCopy(in.Time); err != nil {
		return err
	} else {
		out.Time = newVal.(time.Time)
	}
	return nil
}
开发者ID:alena1108,项目名称:kubernetes,代码行数:8,代码来源:deep_copy_generated.go

示例9: DeepCopy_runtime_SerializerInfo

func DeepCopy_runtime_SerializerInfo(in SerializerInfo, out *SerializerInfo, c *conversion.Cloner) error {
	if in.Serializer == nil {
		out.Serializer = nil
	} else if newVal, err := c.DeepCopy(in.Serializer); err != nil {
		return err
	} else {
		out.Serializer = newVal.(Serializer)
	}
	out.EncodesAsText = in.EncodesAsText
	out.MediaType = in.MediaType
	return nil
}
开发者ID:40a,项目名称:bootkube,代码行数:12,代码来源:deep_copy_generated.go

示例10: DeepCopy_unversioned_Time

func DeepCopy_unversioned_Time(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*Time)
		out := out.(*Time)
		if newVal, err := c.DeepCopy(&in.Time); err != nil {
			return err
		} else {
			out.Time = *newVal.(*time.Time)
		}
		return nil
	}
}
开发者ID:CodeJuan,项目名称:kubernetes,代码行数:12,代码来源:zz_generated.deepcopy.go

示例11: DeepCopy_api_ResourceQuotasStatusByNamespace

func DeepCopy_api_ResourceQuotasStatusByNamespace(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*ResourceQuotasStatusByNamespace)
		out := out.(*ResourceQuotasStatusByNamespace)
		if newVal, err := c.DeepCopy(&in.orderedMap); err != nil {
			return err
		} else {
			out.orderedMap = *newVal.(*orderedMap)
		}
		return nil
	}
}
开发者ID:juanluisvaladas,项目名称:origin,代码行数:12,代码来源:zz_generated.deepcopy.go

示例12: DeepCopy_v1_Image

func DeepCopy_v1_Image(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*Image)
		out := out.(*Image)
		out.TypeMeta = in.TypeMeta
		if err := api_v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
			return err
		}
		out.DockerImageReference = in.DockerImageReference
		if err := runtime.DeepCopy_runtime_RawExtension(&in.DockerImageMetadata, &out.DockerImageMetadata, c); err != nil {
			return err
		}
		out.DockerImageMetadataVersion = in.DockerImageMetadataVersion
		out.DockerImageManifest = in.DockerImageManifest
		if in.DockerImageLayers != nil {
			in, out := &in.DockerImageLayers, &out.DockerImageLayers
			*out = make([]ImageLayer, len(*in))
			for i := range *in {
				(*out)[i] = (*in)[i]
			}
		} else {
			out.DockerImageLayers = nil
		}
		if in.Signatures != nil {
			in, out := &in.Signatures, &out.Signatures
			*out = make([]ImageSignature, len(*in))
			for i := range *in {
				if err := DeepCopy_v1_ImageSignature(&(*in)[i], &(*out)[i], c); err != nil {
					return err
				}
			}
		} else {
			out.Signatures = nil
		}
		if in.DockerImageSignatures != nil {
			in, out := &in.DockerImageSignatures, &out.DockerImageSignatures
			*out = make([][]byte, len(*in))
			for i := range *in {
				if newVal, err := c.DeepCopy(&(*in)[i]); err != nil {
					return err
				} else {
					(*out)[i] = *newVal.(*[]byte)
				}
			}
		} else {
			out.DockerImageSignatures = nil
		}
		out.DockerImageManifestMediaType = in.DockerImageManifestMediaType
		out.DockerImageConfig = in.DockerImageConfig
		return nil
	}
}
开发者ID:juanluisvaladas,项目名称:origin,代码行数:52,代码来源:zz_generated.deepcopy.go

示例13: DeepCopy_v1_Image

func DeepCopy_v1_Image(in Image, out *Image, c *conversion.Cloner) error {
	if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
		return err
	}
	if err := api_v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
		return err
	}
	out.DockerImageReference = in.DockerImageReference
	if err := runtime.DeepCopy_runtime_RawExtension(in.DockerImageMetadata, &out.DockerImageMetadata, c); err != nil {
		return err
	}
	out.DockerImageMetadataVersion = in.DockerImageMetadataVersion
	out.DockerImageManifest = in.DockerImageManifest
	if in.DockerImageLayers != nil {
		in, out := in.DockerImageLayers, &out.DockerImageLayers
		*out = make([]ImageLayer, len(in))
		for i := range in {
			if err := DeepCopy_v1_ImageLayer(in[i], &(*out)[i], c); err != nil {
				return err
			}
		}
	} else {
		out.DockerImageLayers = nil
	}
	if in.Signatures != nil {
		in, out := in.Signatures, &out.Signatures
		*out = make([]ImageSignature, len(in))
		for i := range in {
			if err := DeepCopy_v1_ImageSignature(in[i], &(*out)[i], c); err != nil {
				return err
			}
		}
	} else {
		out.Signatures = nil
	}
	if in.DockerImageSignatures != nil {
		in, out := in.DockerImageSignatures, &out.DockerImageSignatures
		*out = make([][]byte, len(in))
		for i := range in {
			if newVal, err := c.DeepCopy(in[i]); err != nil {
				return err
			} else {
				(*out)[i] = newVal.([]byte)
			}
		}
	} else {
		out.DockerImageSignatures = nil
	}
	out.DockerImageManifestMediaType = in.DockerImageManifestMediaType
	out.DockerImageConfig = in.DockerImageConfig
	return nil
}
开发者ID:ZenoRewn,项目名称:origin,代码行数:52,代码来源:deep_copy_generated.go

示例14: deepCopy_resource_Quantity

func deepCopy_resource_Quantity(in resource.Quantity, out *resource.Quantity, c *conversion.Cloner) error {
	if in.Amount != nil {
		if newVal, err := c.DeepCopy(in.Amount); err != nil {
			return err
		} else {
			out.Amount = newVal.(*inf.Dec)
		}
	} else {
		out.Amount = nil
	}
	out.Format = in.Format
	return nil
}
开发者ID:xachca,项目名称:kubernetes-1.2,代码行数:13,代码来源:deep_copy_generated.go

示例15: DeepCopy_resource_Quantity

func DeepCopy_resource_Quantity(in Quantity, out *Quantity, c *conversion.Cloner) error {
	if in.Amount != nil {
		in, out := in.Amount, &out.Amount
		*out = new(inf_v0.Dec)
		if newVal, err := c.DeepCopy(*in); err != nil {
			return err
		} else {
			**out = newVal.(inf_v0.Dec)
		}
	} else {
		out.Amount = nil
	}
	out.Format = in.Format
	return nil
}
开发者ID:caesarxuchao,项目名称:heapster,代码行数:15,代码来源:deep_copy_generated.go


注:本文中的k8s/io/kubernetes/pkg/conversion.Cloner.DeepCopy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。