Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for EachListItemWithAlloc (0.19 sec)

  1. staging/src/k8s.io/apimachinery/pkg/api/meta/help.go

    // retaining all items in obj as long as any item is referenced, use EachListItemWithAlloc instead.
    func EachListItem(obj runtime.Object, fn func(runtime.Object) error) error {
    	return eachListItem(obj, fn, false)
    }
    
    // EachListItemWithAlloc works like EachListItem, but avoids retaining references to the items slice in obj.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 29 16:25:43 UTC 2023
    - 9.8K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/api/meta/help_test.go

    					t.Fatal("expectObjectNames should be empty")
    				}
    			})
    			t.Run("EachListItemWithAlloc", func(t *testing.T) {
    				expectObjectNames := map[string]struct{}{}
    				for i := 0; i < tc.expectObjectNum; i++ {
    					expectObjectNames[strconv.Itoa(i)] = struct{}{}
    				}
    				list := tc.generateFunc(tc.expectObjectNum)
    				err := EachListItemWithAlloc(list, func(object runtime.Object) error {
    					o, err := Accessor(object)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 29 13:40:46 UTC 2023
    - 12.1K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured_list.go

    	for i := range u.Items {
    		if err := fn(&u.Items[i]); err != nil {
    			return err
    		}
    	}
    	return nil
    }
    
    func (u *UnstructuredList) EachListItemWithAlloc(fn func(runtime.Object) error) error {
    	for i := range u.Items {
    		if err := fn(&Unstructured{Object: u.Items[i].Object}); err != nil {
    			return err
    		}
    	}
    	return nil
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun May 28 04:46:35 UTC 2023
    - 6.3K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apimachinery/pkg/runtime/interfaces.go

    	EachListItem(func(Object) error) error
    	// EachListItemWithAlloc works like EachListItem, but avoids retaining references to a slice of items.
    	// It does this by making a shallow copy of non-pointer items before passing them to fn.
    	//
    	// If the items passed to fn are not retained, or are retained for the same duration, use EachListItem instead for memory efficiency.
    	EachListItemWithAlloc(func(Object) error) error
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun May 28 03:26:35 UTC 2023
    - 19K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apimachinery/pkg/runtime/testing/types.go

    		if !ok {
    			return fmt.Errorf("items member is not an object")
    		}
    		if err := fn(&Unstructured{Object: child}); err != nil {
    			return err
    		}
    	}
    	return nil
    }
    
    func (obj *Unstructured) EachListItemWithAlloc(fn func(runtime.Object) error) error {
    	// EachListItem has allocated a new Object for the user, we can use it directly.
    	return obj.EachListItem(fn)
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun May 28 03:26:35 UTC 2023
    - 11.5K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured.go

    			return fmt.Errorf("items member is not an object: %T", child)
    		}
    		if err := fn(&Unstructured{Object: child}); err != nil {
    			return err
    		}
    	}
    	return nil
    }
    
    func (obj *Unstructured) EachListItemWithAlloc(fn func(runtime.Object) error) error {
    	// EachListItem has allocated a new Object for the user, we can use it directly.
    	return obj.EachListItem(fn)
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun May 28 03:26:35 UTC 2023
    - 13.7K bytes
    - Viewed (0)
Back to top