Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for buildCollectionOptions (0.34 sec)

  1. pkg/kube/krt/join.go

    // Collection[T] merging equal objects into one record
    // in the resulting Collection
    func JoinCollection[T any](cs []Collection[T], opts ...CollectionOption) Collection[T] {
    	o := buildCollectionOptions(opts...)
    	if o.name == "" {
    		o.name = fmt.Sprintf("Join[%v]", ptr.TypeName[T]())
    	}
    	synced := make(chan struct{})
    	c := slices.Map(cs, func(e Collection[T]) internalCollection[T] {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 10 23:33:56 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  2. pkg/kube/krt/internal.go

    	e := Event[O]{
    		Event: o.Event,
    	}
    	if o.Old != nil {
    		e.Old = ptr.Of(any(*o.Old).(O))
    	}
    	if o.New != nil {
    		e.New = ptr.Of(any(*o.New).(O))
    	}
    	return e
    }
    
    func buildCollectionOptions(opts ...CollectionOption) collectionOptions {
    	c := &collectionOptions{}
    	for _, o := range opts {
    		o(c)
    	}
    	if c.stop == nil {
    		c.stop = make(chan struct{})
    	}
    	return *c
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 10 23:33:56 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  3. pkg/kube/krt/informer.go

    // informer for a Collection of type controllers.Object
    func WrapClient[I controllers.ComparableObject](c kclient.Informer[I], opts ...CollectionOption) Collection[I] {
    	o := buildCollectionOptions(opts...)
    	if o.name == "" {
    		o.name = fmt.Sprintf("NewInformer[%v]", ptr.TypeName[I]())
    	}
    	h := &informer[I]{
    		inf:            c,
    		log:            log.WithLabels("owner", o.name),
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jun 10 11:01:46 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  4. pkg/kube/krt/collection.go

    	hm := func(ctx HandlerContext, i I) []O {
    		res := hf(ctx, i)
    		if res == nil {
    			return nil
    		}
    		return []O{*res}
    	}
    	o := buildCollectionOptions(opts...)
    	if o.name == "" {
    		o.name = fmt.Sprintf("Collection[%v,%v]", ptr.TypeName[I](), ptr.TypeName[O]())
    	}
    	return newManyCollection[I, O](c, hm, o)
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 10 23:33:56 UTC 2024
    - 19.4K bytes
    - Viewed (0)
Back to top