Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for nextUID (0.15 sec)

  1. pkg/kube/krt/static.go

    	id   collectionUID
    }
    
    func NewStaticCollection[T any](vals []T) Collection[T] {
    	res := map[Key[T]]T{}
    	for _, v := range vals {
    		res[GetKey(v)] = v
    	}
    	return &staticList[T]{
    		vals: res,
    		id:   nextUID(),
    	}
    }
    
    func (s *staticList[T]) GetKey(k Key[T]) *T {
    	if o, f := s.vals[k]; f {
    		return &o
    	}
    	return nil
    }
    
    // nolint: unused // (not true, its to implement an interface)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 10 23:33:56 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  2. pkg/kube/krt/join.go

    	}()
    	// TODO: in the future, we could have a custom merge function. For now, since we just take the first, we optimize around that case
    	return &join[T]{
    		collectionName: o.name,
    		id:             nextUID(),
    		synced:         synced,
    		collections:    c,
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 10 23:33:56 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  3. pkg/kube/krt/singleton.go

    	Singleton[T]
    	Set(*T)
    }
    
    func NewStatic[T any](initial *T) StaticSingleton[T] {
    	val := new(atomic.Pointer[T])
    	val.Store(initial)
    	x := &static[T]{
    		val:           val,
    		id:            nextUID(),
    		eventHandlers: &handlers[T]{},
    	}
    	return collectionAdapter[T]{x}
    }
    
    // static represents a Collection of a single static value. This can be explicitly Set() to override it
    type static[T any] struct {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 10 23:33:56 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  4. pkg/kube/krt/internal.go

    	}
    	return reflect.DeepEqual(a, b)
    }
    
    type collectionUID uint64
    
    var globalUIDCounter = atomic.NewUint64(1)
    
    func nextUID() collectionUID {
    	return collectionUID(globalUIDCounter.Inc())
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 10 23:33:56 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  5. pkg/kube/krt/informer.go

    		o.name = fmt.Sprintf("NewInformer[%v]", ptr.TypeName[I]())
    	}
    	h := &informer[I]{
    		inf:            c,
    		log:            log.WithLabels("owner", o.name),
    		collectionName: o.name,
    		id:             nextUID(),
    		eventHandlers:  &handlers[I]{},
    		augmentation:   o.augmentation,
    		synced:         make(chan struct{}),
    	}
    
    	go func() {
    		// First, wait for the informer to populate
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jun 10 11:01:46 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  6. pkg/kube/krt/collection.go

    	c := cc.(internalCollection[I])
    	h := &manyCollection[I, O]{
    		transformation:         hf,
    		collectionName:         opts.name,
    		id:                     nextUID(),
    		log:                    log.WithLabels("owner", opts.name),
    		parent:                 c,
    		collectionDependencies: sets.New[collectionUID](),
    		objectDependencies:     map[Key[I]][]*dependency{},
    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