当前位置: 首页>>代码示例>>Golang>>正文


Golang helpers.Spammer类代码示例

本文整理汇总了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))
开发者ID:cloudfoundry-incubator,项目名称:consul-release,代码行数:31,代码来源:spammer_test.go

示例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")
	})
开发者ID:cloudfoundry-incubator,项目名称:consul-release,代码行数:30,代码来源:tls_rotation_test.go


注:本文中的github.com/cloudfoundry-incubator/consul-release/src/acceptance-tests/testing/helpers.Spammer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。