本文整理匯總了Golang中k8s/io/client-go/1/4/pkg/conversion.Cloner類的典型用法代碼示例。如果您正苦於以下問題:Golang Cloner類的具體用法?Golang Cloner怎麽用?Golang Cloner使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Cloner類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: DeepCopy_authentication_UserInfo
func DeepCopy_authentication_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
}
}
示例2: 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
}
}
示例3: DeepCopy_rbac_PolicyRule
func DeepCopy_rbac_PolicyRule(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*PolicyRule)
out := out.(*PolicyRule)
if in.Verbs != nil {
in, out := &in.Verbs, &out.Verbs
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.Verbs = nil
}
if in.AttributeRestrictions == nil {
out.AttributeRestrictions = nil
} else if newVal, err := c.DeepCopy(&in.AttributeRestrictions); err != nil {
return err
} else {
out.AttributeRestrictions = *newVal.(*runtime.Object)
}
if in.APIGroups != nil {
in, out := &in.APIGroups, &out.APIGroups
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.APIGroups = nil
}
if in.Resources != nil {
in, out := &in.Resources, &out.Resources
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.Resources = nil
}
if in.ResourceNames != nil {
in, out := &in.ResourceNames, &out.ResourceNames
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.ResourceNames = nil
}
if in.NonResourceURLs != nil {
in, out := &in.NonResourceURLs, &out.NonResourceURLs
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.NonResourceURLs = nil
}
return nil
}
}
示例4: DeepCopy_authorization_SubjectAccessReviewSpec
func DeepCopy_authorization_SubjectAccessReviewSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*SubjectAccessReviewSpec)
out := out.(*SubjectAccessReviewSpec)
if in.ResourceAttributes != nil {
in, out := &in.ResourceAttributes, &out.ResourceAttributes
*out = new(ResourceAttributes)
**out = **in
} else {
out.ResourceAttributes = nil
}
if in.NonResourceAttributes != nil {
in, out := &in.NonResourceAttributes, &out.NonResourceAttributes
*out = new(NonResourceAttributes)
**out = **in
} else {
out.NonResourceAttributes = nil
}
out.User = in.User
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
}
}
示例5: DeepCopy_runtime_RawExtension
func DeepCopy_runtime_RawExtension(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*RawExtension)
out := out.(*RawExtension)
if in.Raw != nil {
in, out := &in.Raw, &out.Raw
*out = make([]byte, len(*in))
copy(*out, *in)
} else {
out.Raw = nil
}
if in.Object == nil {
out.Object = nil
} else if newVal, err := c.DeepCopy(&in.Object); err != nil {
return err
} else {
out.Object = *newVal.(*Object)
}
return nil
}
}