本文整理匯總了Golang中github.com/cloudfoundry-incubator/consul-release/src/acceptance-tests/testing/helpers.Spammer類的典型用法代碼示例。如果您正苦於以下問題:Golang Spammer類的具體用法?Golang Spammer怎麽用?Golang Spammer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Spammer類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
"errors"
"fmt"
"math/rand"
"sync"
"time"
"github.com/cloudfoundry-incubator/consul-release/src/acceptance-tests/testing/helpers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Spammer", func() {
var (
kv *fakeKV
spammer *helpers.Spammer
prefix string
)
Context("Check", func() {
BeforeEach(func() {
prefix = fmt.Sprintf("some-prefix-%v", rand.Int())
kv = newFakeKV()
kv.AddressCall.Returns.Address = "http://some-address/consul"
spammer = helpers.NewSpammer(kv, time.Duration(0), prefix)
spammer.Spam()
Eventually(func() int {
return kv.SetCall.CallCount.Value()
}).Should(BeNumerically(">", 1))
示例2:
++eoTf//Bw0Hauz0BbM2/aDQga867pCSKQvE7osCgYA+EUGKuS7mYxZ+8K9PaptD
PzkqJZi3GQy4D2Z8LloSVplqZ/Kw3Xw+YNzjTMoPmIVyHpup0i7fHYEogv6rOXZm
cgYzKM/yIulB52SDhaxBnT9Fb01nLL1dLoR1jo9/0iktdEG4Z4510ufXypYpCuDC
8o7ENDRsYz1pez25r6ERhQKBgFReakL2ZGLjaAsC6NR3pB3cSE05qdPFs+1/qamq
j5/gRJqOxwGrr9blV5BWHiTNuTlZKws1vCEhgQLsEqA4+yMVURQyT+t1tScI4zjD
ZIpbRGs+38PnUdf0qTw6HMHmuL2YVq1BcrRXTT0nhLfNKtE3jR7dlJUhNI0QSQOQ
QP9nAoGAQMBWb/rlN4MVHesmKb1vls1Zq8fZd7Mq9nOK37Za7x9t+/7Xx3bfEAm4
nr2+BCcD01LGzoF7p0k9XRyS30RcFa+kABfCmt3ojSEcIrmxlLnxp63CPBm6hoN2
kz9FT4jnME5mUOg+0p5XEfoZUhklll3HWTU/hWVwJzplIRAz3mk=
-----END RSA PRIVATE KEY-----`
)
var _ = Describe("TLS key rotation", func() {
var (
manifest consul.ManifestV2
kv consulclient.HTTPKV
spammer *helpers.Spammer
)
BeforeEach(func() {
var err error
manifest, kv, err = helpers.DeployConsulWithInstanceCount("tls-key-rotation", 3, boshClient, config)
Expect(err).NotTo(HaveOccurred())
Eventually(func() ([]bosh.VM, error) {
return helpers.DeploymentVMs(boshClient, manifest.Name)
}, "1m", "10s").Should(ConsistOf(helpers.GetVMsFromManifest(manifest)))
spammer = helpers.NewSpammer(kv, 1*time.Second, "test-consumer-0")
})