本文整理汇总了Golang中k8s/io/kubernetes/pkg/client/cache.NewTTLStore函数的典型用法代码示例。如果您正苦于以下问题:Golang NewTTLStore函数的具体用法?Golang NewTTLStore怎么用?Golang NewTTLStore使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NewTTLStore函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: NewSimpleModeler
// NewSimpleModeler returns a new SimpleModeler.
// queuedPods: a PodLister that will return pods that have not been scheduled yet.
// scheduledPods: a PodLister that will return pods that we know for sure have been scheduled.
func NewSimpleModeler(queuedPods, scheduledPods ExtendedPodLister) *SimpleModeler {
return &SimpleModeler{
queuedPods: queuedPods,
scheduledPods: scheduledPods,
assumedPods: &cache.StoreToPodLister{
cache.NewTTLStore(cache.MetaNamespaceKeyFunc, 30*time.Second),
},
}
}
开发者ID:jmferrer,项目名称:kubernetes,代码行数:12,代码来源:modeler.go
示例2: CreateStore
func CreateStore(kind string, c cache.Getter, sel Selector, resync time.Duration, ctx context.Context) (cache.Store, error) {
obj, ok := resources[kind]
if !ok {
return nil, fmt.Errorf("Object type %q not supported", kind)
}
store := cache.NewTTLStore(framework.DeletionHandlingMetaNamespaceKeyFunc, cacheTTL)
selector := selectorFromMap(sel)
lw := getListWatch(kind, c, selector)
cache.NewReflector(lw, obj, store, resync).RunUntil(ctx.Done())
return store, nil
}
开发者ID:albertrdixon,项目名称:romulus,代码行数:12,代码来源:kubernetes.go
示例3: NewObjectCache
// NewObjectCache creates ObjectCache with an updater.
// updater returns an object to cache.
func NewObjectCache(f func() (interface{}, error), ttl time.Duration) *ObjectCache {
return &ObjectCache{
updater: f,
cache: expirationCache.NewTTLStore(stringKeyFunc, ttl),
}
}
开发者ID:CodeJuan,项目名称:kubernetes,代码行数:8,代码来源:object_cache.go
示例4: NewControllerExpectations
// NewControllerExpectations returns a store for ControlleeExpectations.
func NewControllerExpectations() *ControllerExpectations {
return &ControllerExpectations{cache.NewTTLStore(ExpKeyFunc, ExpectationsTimeout)}
}
开发者ID:arunchaudhary09,项目名称:kubernetes,代码行数:4,代码来源:controller_utils.go
示例5: newProjectObjectListCache
// newProjectObjectListCache creates a cache to hold object list objects that will expire with the given ttl.
func newProjectObjectListCache(ttl time.Duration) projectObjectListStore {
return &projectObjectListCache{
store: cache.NewTTLStore(metaProjectObjectListKeyFunc, ttl),
}
}
开发者ID:Xmagicer,项目名称:origin,代码行数:6,代码来源:projectcache.go
注:本文中的k8s/io/kubernetes/pkg/client/cache.NewTTLStore函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论