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


Golang consul.ManifestV2类代码示例

本文整理汇总了Golang中github.com/pivotal-cf-experimental/destiny/consul.ManifestV2的典型用法代码示例。如果您正苦于以下问题:Golang ManifestV2类的具体用法?Golang ManifestV2怎么用?Golang ManifestV2使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ManifestV2类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1:

package consul_test

import (
	"github.com/pivotal-cf-experimental/destiny/consul"
	"github.com/pivotal-cf-experimental/destiny/core"
	"github.com/pivotal-cf-experimental/destiny/iaas"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Job", func() {
	Context("Manifest V2", func() {
		var (
			manifest consul.ManifestV2
		)
		BeforeEach(func() {
			var err error
			manifest, err = consul.NewManifestV2(consul.ConfigV2{
				AZs: []consul.ConfigAZ{
					{
						IPRange: "10.244.4.0/24",
						Nodes:   1,
						Name:    "z1",
					},
				},
			}, iaas.NewWardenConfig())
			Expect(err).NotTo(HaveOccurred())
		})
		Describe("SetInstanceCount", func() {
			It("updates the instance count", func() {
开发者ID:pivotal-cf-experimental,项目名称:destiny,代码行数:31,代码来源:job_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

示例3:

	"github.com/cloudfoundry-incubator/consul-release/src/acceptance-tests/testing/consulclient"
	"github.com/cloudfoundry-incubator/consul-release/src/acceptance-tests/testing/helpers"
	"github.com/pivotal-cf-experimental/bosh-test/bosh"
	"github.com/pivotal-cf-experimental/destiny/consul"
	"github.com/pivotal-cf-experimental/destiny/turbulence"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	turbulenceclient "github.com/pivotal-cf-experimental/bosh-test/turbulence"
)

var _ = Describe("quorum loss", func() {
	var (
		turbulenceClient   turbulenceclient.Client
		turbulenceManifest turbulence.Manifest
		consulManifest     consul.ManifestV2
		kv                 consulclient.HTTPKV
	)

	BeforeEach(func() {
		By("deploying turbulence", func() {
			var err error
			turbulenceManifest, err = helpers.DeployTurbulence(boshClient, config)
			Expect(err).NotTo(HaveOccurred())

			Eventually(func() ([]bosh.VM, error) {
				return helpers.DeploymentVMs(boshClient, turbulenceManifest.Name)
			}, "1m", "10s").Should(ConsistOf(helpers.GetTurbulenceVMsFromManifest(turbulenceManifest)))

			turbulenceClient = helpers.NewTurbulenceClient(turbulenceManifest)
		})
开发者ID:cloudfoundry-incubator,项目名称:consul-release,代码行数:32,代码来源:quorum_loss_test.go

示例4:

	"time"

	"github.com/cloudfoundry-incubator/consul-release/src/acceptance-tests/testing/consulclient"
	"github.com/cloudfoundry-incubator/consul-release/src/acceptance-tests/testing/helpers"
	"github.com/pivotal-cf-experimental/bosh-test/bosh"
	"github.com/pivotal-cf-experimental/destiny/consul"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Scaling up Instances", func() {
	var (
		manifest  consul.ManifestV2
		kv        consulclient.HTTPKV
		testKey   string
		testValue string
		spammer   *helpers.Spammer
	)

	AfterEach(func() {
		if !CurrentGinkgoTestDescription().Failed {
			err := boshClient.DeleteDeployment(manifest.Name)
			Expect(err).NotTo(HaveOccurred())
		}
	})

	Describe("scaling from 1 node to 3", func() {
		BeforeEach(func() {
			guid, err := helpers.NewGUID()
			Expect(err).NotTo(HaveOccurred())
开发者ID:cloudfoundry-incubator,项目名称:consul-release,代码行数:31,代码来源:scale_up_instances_test.go

示例5:

import (
	"fmt"

	"github.com/cloudfoundry-incubator/consul-release/src/acceptance-tests/testing/helpers"
	testconsumerclient "github.com/cloudfoundry-incubator/consul-release/src/acceptance-tests/testing/testconsumer/client"
	"github.com/pivotal-cf-experimental/bosh-test/bosh"
	"github.com/pivotal-cf-experimental/destiny/consul"
	"github.com/pivotal-cf-experimental/destiny/core"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Health Check", func() {
	var (
		manifest consul.ManifestV2
		tcClient testconsumerclient.Client
	)

	BeforeEach(func() {
		var err error

		manifest, _, err = helpers.DeployConsulWithInstanceCount("health-check", 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)))

		tcClient = testconsumerclient.New(fmt.Sprintf("http://%s:6769", manifest.InstanceGroups[1].Networks[0].StaticIPs[0]))
	})
开发者ID:cloudfoundry-incubator,项目名称:consul-release,代码行数:31,代码来源:health_check_services_test.go


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