Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudListingPool ¶
type CloudListingPool struct { // The pool that is re-populated via re-list from cloud, and written to // from controller *InMemoryPool // contains filtered or unexported fields }
CloudListingPool wraps InMemoryPool but relists from the cloud periodically.
func NewCloudListingPool ¶
func NewCloudListingPool(k keyFunc, lister cloudLister, relistPeriod time.Duration) *CloudListingPool
NewCloudListingPool replenishes the InMemoryPool through a background goroutine that lists from the given cloudLister.
func (*CloudListingPool) Add ¶
func (c *CloudListingPool) Add(key string, obj interface{})
Add simply adds to the underlying pool.
func (*CloudListingPool) Delete ¶
func (c *CloudListingPool) Delete(key string)
Delete just deletes from underlying pool.
func (*CloudListingPool) ReplenishPool ¶
func (c *CloudListingPool) ReplenishPool()
ReplenishPool lists through the cloudLister and inserts into the pool.
func (*CloudListingPool) Snapshot ¶
func (c *CloudListingPool) Snapshot() map[string]interface{}
Snapshot just snapshots the underlying pool.
type InMemoryPool ¶
type InMemoryPool struct {
cache.ThreadSafeStore
}
InMemoryPool is used as a cache for cluster resource pools.
func NewInMemoryPool ¶
func NewInMemoryPool() *InMemoryPool
NewInMemoryPool creates an InMemoryPool.
func (*InMemoryPool) Snapshot ¶
func (p *InMemoryPool) Snapshot() map[string]interface{}
Snapshot returns a read only copy of the k:v pairs in the store. Caller beware: Violates traditional snapshot guarantees.
type Snapshotter ¶
type Snapshotter interface { Snapshot() map[string]interface{} cache.ThreadSafeStore }
Snapshotter is an interface capable of providing a consistent snapshot of the underlying storage implementation of a pool. It does not guarantee thread safety of snapshots, so they should be treated as read only unless the implementation specifies otherwise.