本文整理匯總了Golang中github.com/cloudfoundry/storeadapter.StoreNode.Value方法的典型用法代碼示例。如果您正苦於以下問題:Golang StoreNode.Value方法的具體用法?Golang StoreNode.Value怎麽用?Golang StoreNode.Value使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/cloudfoundry/storeadapter.StoreNode
的用法示例。
在下文中一共展示了StoreNode.Value方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: MaintainNode
func (adapter *ETCDStoreAdapter) MaintainNode(storeNode storeadapter.StoreNode) (<-chan bool, chan (chan bool), error) {
if storeNode.TTL == 0 {
return nil, nil, storeadapter.ErrorInvalidTTL
}
if len(storeNode.Value) == 0 {
guid, err := uuid.NewV4()
if err != nil {
return nil, nil, err
}
storeNode.Value = []byte(guid.String())
}
releaseNode := make(chan chan bool)
nodeStatus := make(chan bool)
go adapter.maintainNode(storeNode, nodeStatus, releaseNode)
return nodeStatus, releaseNode, nil
}
示例2:
})
})
})
}
}
Context("LegacyFinder", func() {
BeforeEach(func() {
finder = dopplerservice.NewLegacyFinder(storeAdapter, 1234, preferredCallback, updateCallback, loggertesthelper.Logger())
node = storeadapter.StoreNode{
Key: dopplerservice.LEGACY_ROOT + "/z1/loggregator_z1/0",
Value: []byte("10.0.0.1"),
}
updateNode = node
updateNode.Value = []byte("10.0.0.2")
})
Context("Basics", testFinder(map[string]string{"/z1/loggregator_z1/0": "udp://10.0.0.1:1234"}))
Context("Update", testUpdateFinder(map[string]string{"/z1/loggregator_z1/0": "udp://10.0.0.2:1234"}))
})
Context("Finder", func() {
var preferredProtocol string
BeforeEach(func() {
preferredProtocol = "udp"
})
JustBeforeEach(func() {
var err error