本文整理汇总了Golang中github.com/cloudfoundry/hm9000/models.PendingStartMessage.StoreKey方法的典型用法代码示例。如果您正苦于以下问题:Golang PendingStartMessage.StoreKey方法的具体用法?Golang PendingStartMessage.StoreKey怎么用?Golang PendingStartMessage.StoreKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/cloudfoundry/hm9000/models.PendingStartMessage
的用法示例。
在下文中一共展示了PendingStartMessage.StoreKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: appendStartMessageIfNotDuplicate
func (a *appAnalyzer) appendStartMessageIfNotDuplicate(message models.PendingStartMessage, loggingMessage string, additionalDetails map[string]string) (didAppend bool) {
existingMessage, alreadyQueued := a.existingPendingStartMessages[message.StoreKey()]
if !alreadyQueued {
a.logger.Info(fmt.Sprintf("Enqueuing Start Message: %s", loggingMessage), message.LogDescription(), additionalDetails)
a.startMessages[message.StoreKey()] = message
return true
} else {
a.logger.Info(fmt.Sprintf("Skipping Already Enqueued Start Message: %s", loggingMessage), existingMessage.LogDescription(), additionalDetails)
return false
}
}
示例2:
Describe("Saving start messages", func() {
BeforeEach(func() {
err := store.SavePendingStartMessages(
message1,
message2,
)
Ω(err).ShouldNot(HaveOccurred())
})
It("stores the passed in start messages", func() {
node, err := storeAdapter.ListRecursively("/hm/v1/start")
Ω(err).ShouldNot(HaveOccurred())
Ω(node.ChildNodes).Should(HaveLen(2))
Ω(node.ChildNodes).Should(ContainElement(storenodematchers.MatchStoreNode(storeadapter.StoreNode{
Key: "/hm/v1/start/" + message1.StoreKey(),
Value: message1.ToJSON(),
TTL: 0,
})))
Ω(node.ChildNodes).Should(ContainElement(storenodematchers.MatchStoreNode(storeadapter.StoreNode{
Key: "/hm/v1/start/" + message2.StoreKey(),
Value: message2.ToJSON(),
TTL: 0,
})))
})
})
Describe("Fetching start message", func() {
Context("When the start message is present", func() {
BeforeEach(func() {
err := store.SavePendingStartMessages(