當前位置: 首頁>>代碼示例>>Golang>>正文


Golang ETCDClusterRunner.NodeURLS方法代碼示例

本文整理匯總了Golang中github.com/cloudfoundry/storeadapter/storerunner/etcdstorerunner.ETCDClusterRunner.NodeURLS方法的典型用法代碼示例。如果您正苦於以下問題:Golang ETCDClusterRunner.NodeURLS方法的具體用法?Golang ETCDClusterRunner.NodeURLS怎麽用?Golang ETCDClusterRunner.NodeURLS使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/cloudfoundry/storeadapter/storerunner/etcdstorerunner.ETCDClusterRunner的用法示例。


在下文中一共展示了ETCDClusterRunner.NodeURLS方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1:

	bbsURL = &url.URL{
		Scheme: "http",
		Host:   bbsAddress,
	}

	bbsClient = bbs.NewClient(bbsURL.String())

	auctioneerServer = ghttp.NewServer()
	auctioneerServer.UnhandledRequestStatusCode = http.StatusAccepted
	auctioneerServer.AllowUnhandledRequests = true

	bbsArgs = bbstestrunner.Args{
		Address:           bbsAddress,
		AdvertiseURL:      bbsURL.String(),
		AuctioneerAddress: auctioneerServer.URL(),
		EtcdCluster:       strings.Join(etcdRunner.NodeURLS(), ","),
		ConsulCluster:     consulRunner.ConsulCluster(),

		EncryptionKeys: []string{"label:key"},
		ActiveKeyLabel: "label",
	}
})

var _ = BeforeEach(func() {
	etcdRunner.Start()
	consulRunner.Start()
	consulRunner.WaitUntilReady()

	bbsRunner = bbstestrunner.New(bbsPath, bbsArgs)
	bbsProcess = ginkgomon.Invoke(bbsRunner)
開發者ID:emc-xchallenge,項目名稱:tps,代碼行數:30,代碼來源:main_suite_test.go

示例2:

	etcdRunner = etcdstorerunner.NewETCDClusterRunner(5001+config.GinkgoConfig.ParallelNode, 1, nil)

	consulRunner = consulrunner.NewClusterRunner(
		9001+config.GinkgoConfig.ParallelNode*consulrunner.PortOffsetLength,
		1,
		"http",
	)

	etcdRunner.Start()
	bbsAddress := fmt.Sprintf("127.0.0.1:%d", 13000+GinkgoParallelNode())
	bbsBinPath = string(payload)
	bbsArgs = bbsrunner.Args{
		Address:           bbsAddress,
		AdvertiseURL:      "http://" + bbsAddress,
		AuctioneerAddress: "some-address",
		EtcdCluster:       etcdRunner.NodeURLS()[0],
		ConsulCluster:     consulRunner.ConsulCluster(),

		EncryptionKeys: []string{"label:key"},
		ActiveKeyLabel: "label",
	}
	bbsClient = bbs.NewClient("http://" + bbsAddress)

	consulRunner.Start()
	consulRunner.WaitUntilReady()
})

var _ = SynchronizedAfterSuite(func() {
	consulRunner.Stop()
	etcdRunner.KillWithFire()
}, func() {
開發者ID:jiangytcn,項目名稱:rep,代碼行數:31,代碼來源:internal_suite_test.go

示例3: TestDB

func TestDB(t *testing.T) {
	RegisterFailHandler(Fail)

	etcdPort = 4001 + GinkgoParallelNode()
	etcdUrl = fmt.Sprintf("http://127.0.0.1:%d", etcdPort)
	etcdRunner = etcdstorerunner.NewETCDClusterRunner(etcdPort, 1)
	etcdRunner.Start()
	etcdClient = etcdRunner.Adapter()

	RunSpecs(t, "DB Suite")

	etcdRunner.Stop()
}

var _ = BeforeSuite(func() {
	Expect(len(etcdRunner.NodeURLS())).Should(BeNumerically(">=", 1))

	etcdVersionUrl := etcdRunner.NodeURLS()[0] + "/version"
	resp, err := http.Get(etcdVersionUrl)
	Expect(err).ToNot(HaveOccurred())

	defer resp.Body.Close()
	body, err := ioutil.ReadAll(resp.Body)
	Expect(err).ToNot(HaveOccurred())

	// response body: {"etcdserver":"2.1.1","etcdcluster":"2.1.0"}
	Expect(string(body)).To(ContainSubstring(etcdVersion))
})

var _ = BeforeEach(func() {
	etcdRunner.Reset()
開發者ID:krumts,項目名稱:gorouter,代碼行數:31,代碼來源:db_suite_test.go

示例4:

	)

	BeforeSuite(func() {
		localIP, _ = localip.LocalIP()

		etcdPort := 5500 + ginkgoConfig.GinkgoConfig.ParallelNode*10
		etcdRunner = etcdstorerunner.NewETCDClusterRunner(etcdPort, 1, nil)
		etcdRunner.Start()

		etcdAdapter = etcdRunner.Adapter(nil)

		conf = config.Config{
			JobName: "doppler_z1",
			Index:   "0",
			EtcdMaxConcurrentRequests: 10,
			EtcdUrls:                  etcdRunner.NodeURLS(),
			Zone:                      "z1",
			IncomingUDPPort:           1234,
			IncomingTCPPort:           5678,
			OutgoingPort:              8888,
		}
	})

	AfterSuite(func() {
		etcdAdapter.Disconnect()
		etcdRunner.Stop()
	})
	var stopChan chan chan bool

	BeforeEach(func() {
		etcdRunner.Reset()
開發者ID:kei-yamazaki,項目名稱:loggregator,代碼行數:31,代碼來源:announcer_test.go

示例5:

		routingAPIBinPath = string(routingAPIBin)
		SetDefaultEventuallyTimeout(15 * time.Second)
	},
)

var _ = SynchronizedAfterSuite(func() {}, func() {
	gexec.CleanupBuildArtifacts()
})

var _ = BeforeEach(func() {
	etcdPort = 4001 + GinkgoParallelNode()
	etcdUrl = fmt.Sprintf("http://127.0.0.1:%d", etcdPort)
	etcdRunner = etcdstorerunner.NewETCDClusterRunner(etcdPort, 1, nil)
	etcdRunner.Start()

	etcdVersionUrl := etcdRunner.NodeURLS()[0] + "/version"
	resp, err := http.Get(etcdVersionUrl)
	Expect(err).ToNot(HaveOccurred())

	defer resp.Body.Close()
	body, err := ioutil.ReadAll(resp.Body)
	Expect(err).ToNot(HaveOccurred())

	// response body: {"etcdserver":"2.1.1","etcdcluster":"2.1.0"}
	Expect(string(body)).To(ContainSubstring(etcdVersion))

	etcdAdapter = etcdRunner.Adapter(nil)
	routingAPIPort = uint16(6900 + GinkgoParallelNode())
	routingAPIIP = "127.0.0.1"
	routingAPISystemDomain = "example.com"
	routingAPIAddress = fmt.Sprintf("%s:%d", routingAPIIP, routingAPIPort)
開發者ID:yingkitw,項目名稱:gorouter,代碼行數:31,代碼來源:routing_api_suite_test.go


注:本文中的github.com/cloudfoundry/storeadapter/storerunner/etcdstorerunner.ETCDClusterRunner.NodeURLS方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。