當前位置: 首頁>>代碼示例>>Golang>>正文


Golang conversion.Cloner類代碼示例

本文整理匯總了Golang中k8s/io/apimachinery/pkg/conversion.Cloner的典型用法代碼示例。如果您正苦於以下問題:Golang Cloner類的具體用法?Golang Cloner怎麽用?Golang Cloner使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Cloner類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: DeepCopy_v1beta1_SubjectAccessReviewSpec

func DeepCopy_v1beta1_SubjectAccessReviewSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*SubjectAccessReviewSpec)
		out := out.(*SubjectAccessReviewSpec)
		*out = *in
		if in.ResourceAttributes != nil {
			in, out := &in.ResourceAttributes, &out.ResourceAttributes
			*out = new(ResourceAttributes)
			**out = **in
		}
		if in.NonResourceAttributes != nil {
			in, out := &in.NonResourceAttributes, &out.NonResourceAttributes
			*out = new(NonResourceAttributes)
			**out = **in
		}
		if in.Groups != nil {
			in, out := &in.Groups, &out.Groups
			*out = make([]string, len(*in))
			copy(*out, *in)
		}
		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)
				}
			}
		}
		return nil
	}
}
開發者ID:kubernetes,項目名稱:kubernetes,代碼行數:34,代碼來源:zz_generated.deepcopy.go

示例2: DeepCopy_v1beta1_StatefulSetSpec

func DeepCopy_v1beta1_StatefulSetSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*StatefulSetSpec)
		out := out.(*StatefulSetSpec)
		*out = *in
		if in.Replicas != nil {
			in, out := &in.Replicas, &out.Replicas
			*out = new(int32)
			**out = **in
		}
		if in.Selector != nil {
			in, out := &in.Selector, &out.Selector
			if newVal, err := c.DeepCopy(*in); err != nil {
				return err
			} else {
				*out = newVal.(*v1.LabelSelector)
			}
		}
		if err := api_v1.DeepCopy_v1_PodTemplateSpec(&in.Template, &out.Template, c); err != nil {
			return err
		}
		if in.VolumeClaimTemplates != nil {
			in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates
			*out = make([]api_v1.PersistentVolumeClaim, len(*in))
			for i := range *in {
				if err := api_v1.DeepCopy_v1_PersistentVolumeClaim(&(*in)[i], &(*out)[i], c); err != nil {
					return err
				}
			}
		}
		return nil
	}
}
開發者ID:kubernetes,項目名稱:kubernetes,代碼行數:33,代碼來源:zz_generated.deepcopy.go

示例3: DeepCopy_v1alpha1_AdmissionPluginConfiguration

func DeepCopy_v1alpha1_AdmissionPluginConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*AdmissionPluginConfiguration)
		out := out.(*AdmissionPluginConfiguration)
		*out = *in
		if newVal, err := c.DeepCopy(&in.Configuration); err != nil {
			return err
		} else {
			out.Configuration = *newVal.(*runtime.RawExtension)
		}
		return nil
	}
}
開發者ID:kubernetes,項目名稱:kubernetes,代碼行數:13,代碼來源:zz_generated.deepcopy.go

示例4: DeepCopy_v1_Scale

func DeepCopy_v1_Scale(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*Scale)
		out := out.(*Scale)
		*out = *in
		if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
			return err
		} else {
			out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
		}
		return nil
	}
}
開發者ID:kubernetes,項目名稱:kubernetes,代碼行數:13,代碼來源:zz_generated.deepcopy.go

示例5: DeepCopy_v1beta1_DaemonSet

func DeepCopy_v1beta1_DaemonSet(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*DaemonSet)
		out := out.(*DaemonSet)
		*out = *in
		if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
			return err
		} else {
			out.ObjectMeta = *newVal.(*v1.ObjectMeta)
		}
		if err := DeepCopy_v1beta1_DaemonSetSpec(&in.Spec, &out.Spec, c); err != nil {
			return err
		}
		return nil
	}
}
開發者ID:kubernetes,項目名稱:kubernetes,代碼行數:16,代碼來源:zz_generated.deepcopy.go

示例6: DeepCopy_authentication_TokenReview

func DeepCopy_authentication_TokenReview(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*TokenReview)
		out := out.(*TokenReview)
		*out = *in
		if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
			return err
		} else {
			out.ObjectMeta = *newVal.(*v1.ObjectMeta)
		}
		if err := DeepCopy_authentication_TokenReviewStatus(&in.Status, &out.Status, c); err != nil {
			return err
		}
		return nil
	}
}
開發者ID:kubernetes,項目名稱:kubernetes,代碼行數:16,代碼來源:zz_generated.deepcopy.go

示例7: DeepCopy_v1beta1_SelfSubjectAccessReview

func DeepCopy_v1beta1_SelfSubjectAccessReview(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*SelfSubjectAccessReview)
		out := out.(*SelfSubjectAccessReview)
		*out = *in
		if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
			return err
		} else {
			out.ObjectMeta = *newVal.(*v1.ObjectMeta)
		}
		if err := DeepCopy_v1beta1_SelfSubjectAccessReviewSpec(&in.Spec, &out.Spec, c); err != nil {
			return err
		}
		return nil
	}
}
開發者ID:kubernetes,項目名稱:kubernetes,代碼行數:16,代碼來源:zz_generated.deepcopy.go

示例8: DeepCopy_extensions_Scale

func DeepCopy_extensions_Scale(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*Scale)
		out := out.(*Scale)
		*out = *in
		if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
			return err
		} else {
			out.ObjectMeta = *newVal.(*v1.ObjectMeta)
		}
		if err := DeepCopy_extensions_ScaleStatus(&in.Status, &out.Status, c); err != nil {
			return err
		}
		return nil
	}
}
開發者ID:kubernetes,項目名稱:kubernetes,代碼行數:16,代碼來源:zz_generated.deepcopy.go

示例9: DeepCopy_extensions_ScaleStatus

func DeepCopy_extensions_ScaleStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*ScaleStatus)
		out := out.(*ScaleStatus)
		*out = *in
		if in.Selector != nil {
			in, out := &in.Selector, &out.Selector
			if newVal, err := c.DeepCopy(*in); err != nil {
				return err
			} else {
				*out = newVal.(*v1.LabelSelector)
			}
		}
		return nil
	}
}
開發者ID:kubernetes,項目名稱:kubernetes,代碼行數:16,代碼來源:zz_generated.deepcopy.go

示例10: DeepCopy_extensions_PodSecurityPolicy

func DeepCopy_extensions_PodSecurityPolicy(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*PodSecurityPolicy)
		out := out.(*PodSecurityPolicy)
		*out = *in
		if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
			return err
		} else {
			out.ObjectMeta = *newVal.(*v1.ObjectMeta)
		}
		if err := DeepCopy_extensions_PodSecurityPolicySpec(&in.Spec, &out.Spec, c); err != nil {
			return err
		}
		return nil
	}
}
開發者ID:kubernetes,項目名稱:kubernetes,代碼行數:16,代碼來源:zz_generated.deepcopy.go

示例11: DeepCopy_v1beta1_PodDisruptionBudgetSpec

func DeepCopy_v1beta1_PodDisruptionBudgetSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*PodDisruptionBudgetSpec)
		out := out.(*PodDisruptionBudgetSpec)
		*out = *in
		if in.Selector != nil {
			in, out := &in.Selector, &out.Selector
			if newVal, err := c.DeepCopy(*in); err != nil {
				return err
			} else {
				*out = newVal.(*v1.LabelSelector)
			}
		}
		return nil
	}
}
開發者ID:kubernetes,項目名稱:kubernetes,代碼行數:16,代碼來源:zz_generated.deepcopy.go

示例12: DeepCopy_v1_InternalEvent

func DeepCopy_v1_InternalEvent(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*InternalEvent)
		out := out.(*InternalEvent)
		*out = *in
		// in.Object is kind 'Interface'
		if in.Object != nil {
			if newVal, err := c.DeepCopy(&in.Object); err != nil {
				return err
			} else {
				out.Object = *newVal.(*runtime.Object)
			}
		}
		return nil
	}
}
開發者ID:kubernetes,項目名稱:kubernetes,代碼行數:16,代碼來源:zz_generated.deepcopy.go

示例13: DeepCopy_v2alpha1_JobTemplateSpec

func DeepCopy_v2alpha1_JobTemplateSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*JobTemplateSpec)
		out := out.(*JobTemplateSpec)
		*out = *in
		if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
			return err
		} else {
			out.ObjectMeta = *newVal.(*v1.ObjectMeta)
		}
		if err := DeepCopy_v2alpha1_JobSpec(&in.Spec, &out.Spec, c); err != nil {
			return err
		}
		return nil
	}
}
開發者ID:kubernetes,項目名稱:kubernetes,代碼行數:16,代碼來源:zz_generated.deepcopy.go

示例14: DeepCopy_componentconfig_AdmissionPluginConfiguration

func DeepCopy_componentconfig_AdmissionPluginConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*AdmissionPluginConfiguration)
		out := out.(*AdmissionPluginConfiguration)
		*out = *in
		// in.Configuration is kind 'Interface'
		if in.Configuration != nil {
			if newVal, err := c.DeepCopy(&in.Configuration); err != nil {
				return err
			} else {
				out.Configuration = *newVal.(*runtime.Object)
			}
		}
		return nil
	}
}
開發者ID:kubernetes,項目名稱:kubernetes,代碼行數:16,代碼來源:zz_generated.deepcopy.go

示例15: DeepCopy_apiregistration_APIService

func DeepCopy_apiregistration_APIService(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*APIService)
		out := out.(*APIService)
		*out = *in
		if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
			return err
		} else {
			out.ObjectMeta = *newVal.(*v1.ObjectMeta)
		}
		if err := DeepCopy_apiregistration_APIServiceSpec(&in.Spec, &out.Spec, c); err != nil {
			return err
		}
		return nil
	}
}
開發者ID:kubernetes,項目名稱:kubernetes,代碼行數:16,代碼來源:zz_generated.deepcopy.go


注:本文中的k8s/io/apimachinery/pkg/conversion.Cloner類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。