本文整理匯總了Golang中github.com/cloudfoundry/storeadapter.StoreAdapter.UpdateDirTTL方法的典型用法代碼示例。如果您正苦於以下問題:Golang StoreAdapter.UpdateDirTTL方法的具體用法?Golang StoreAdapter.UpdateDirTTL怎麽用?Golang StoreAdapter.UpdateDirTTL使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/cloudfoundry/storeadapter.StoreAdapter
的用法示例。
在下文中一共展示了StoreAdapter.UpdateDirTTL方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
assertNoDataOnChannel(outRemoveChan)
adapter.Delete(path.Join("/loggregator/services", app1Service1.AppId, app1Service1.Id()))
assertNoDataOnChannel(outAddChan)
Expect(<-outRemoveChan).To(Equal(app1Service1))
close(done)
})
})
Context("when an existing app service expires", func() {
It("removes the app service from the cache", func() {
app2Service2 := domain.AppService{AppId: "app-2", Url: "syslog://foo/a"}
adapter.Create(buildNode(app2Service2))
Expect(<-outAddChan).To(Equal(app2Service2))
adapter.UpdateDirTTL("/loggregator/services/app-2", 1)
time.Sleep(2 * time.Second)
assertNoDataOnChannel(outAddChan)
assertNoDataOnChannel(outRemoveChan)
adapter.Create(buildNode(app2Service2))
Expect(<-outAddChan).To(Equal(app2Service2))
})
})
})
})