• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Golang cc_messages.DesireAppRequestFromCC类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1:

	"github.com/cloudfoundry-incubator/diego-ssh/keys/fake_keys"
	"github.com/cloudfoundry-incubator/diego-ssh/routes"
	"github.com/cloudfoundry-incubator/nsync/recipebuilder"
	"github.com/cloudfoundry-incubator/routing-info/cfroutes"
	"github.com/cloudfoundry-incubator/runtime-schema/cc_messages"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/pivotal-golang/lager/lagertest"
)

var _ = Describe("Buildpack Recipe Builder", func() {
	var (
		builder        *recipebuilder.BuildpackRecipeBuilder
		err            error
		desiredAppReq  cc_messages.DesireAppRequestFromCC
		lifecycles     map[string]string
		egressRules    []*models.SecurityGroupRule
		fakeKeyFactory *fake_keys.FakeSSHKeyFactory
		logger         *lagertest.TestLogger
	)

	defaultNofile := recipebuilder.DefaultFileDescriptorLimit

	BeforeEach(func() {
		logger = lagertest.NewTestLogger("test")

		lifecycles = map[string]string{
			"buildpack/some-stack": "some-lifecycle.tgz",
			"docker":               "the/docker/lifecycle/path.tgz",
		}
开发者ID:cf-routing,项目名称:nsync,代码行数:30,代码来源:buildpack_recipe_builder_test.go


示例2:

	"github.com/cloudfoundry/dropsonde/metric_sender/fake"
	"github.com/cloudfoundry/dropsonde/metrics"
	"github.com/pivotal-golang/lager/lagertest"

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

var _ = Describe("DesireAppHandler", func() {
	var (
		logger           *lagertest.TestLogger
		fakeBBS          *fake_bbs.FakeClient
		buildpackBuilder *fakes.FakeRecipeBuilder
		dockerBuilder    *fakes.FakeRecipeBuilder
		desireAppRequest cc_messages.DesireAppRequestFromCC
		metricSender     *fake.FakeMetricSender

		request          *http.Request
		responseRecorder *httptest.ResponseRecorder
	)

	BeforeEach(func() {
		var err error

		logger = lagertest.NewTestLogger("test")
		fakeBBS = new(fake_bbs.FakeClient)
		buildpackBuilder = new(fakes.FakeRecipeBuilder)
		dockerBuilder = new(fakes.FakeRecipeBuilder)

		routingInfo, err := cc_messages.CCHTTPRoutes{
开发者ID:cf-routing,项目名称:nsync,代码行数:31,代码来源:desire_app_handler_test.go


示例3:

		egressRules = []*models.SecurityGroupRule{
			{
				Protocol:     "TCP",
				Destinations: []string{"0.0.0.0/0"},
				PortRange:    &models.PortRange{Start: 80, End: 443},
			},
		}
		fakeKeyFactory = &fake_keys.FakeSSHKeyFactory{}
		config := recipebuilder.Config{lifecycles, "http://file-server.com", fakeKeyFactory}
		builder = recipebuilder.NewDockerRecipeBuilder(logger, config)
	})

	Context("Build", func() {
		var (
			err           error
			desiredAppReq cc_messages.DesireAppRequestFromCC
			desiredLRP    *models.DesiredLRP
		)

		BeforeEach(func() {
			routingInfo, err := cc_messages.CCHTTPRoutes{
				{Hostname: "route1"},
				{Hostname: "route2"},
			}.CCRouteInfo()
			Expect(err).NotTo(HaveOccurred())

			desiredAppReq = cc_messages.DesireAppRequestFromCC{
				ProcessGuid:       "the-app-guid-the-app-version",
				Stack:             "some-stack",
				StartCommand:      "the-start-command with-arguments",
				DockerImageUrl:    "user/repo:tag",
开发者ID:cf-routing,项目名称:nsync,代码行数:31,代码来源:docker_recipe_builder_test.go


示例4:

			cancel <-chan struct{},
			httpClient *http.Client,
			fingerprints <-chan []cc_messages.CCDesiredAppFingerprint,
		) (<-chan []cc_messages.DesireAppRequestFromCC, <-chan error) {
			batch := <-fingerprints

			results := []cc_messages.DesireAppRequestFromCC{}
			for _, fingerprint := range batch {
				routeInfo, err := cc_messages.CCHTTPRoutes{
					{Hostname: "host-" + fingerprint.ProcessGuid},
				}.CCRouteInfo()
				Expect(err).NotTo(HaveOccurred())

				lrp := cc_messages.DesireAppRequestFromCC{
					ProcessGuid: fingerprint.ProcessGuid,
					ETag:        fingerprint.ETag,
					RoutingInfo: routeInfo,
				}
				if strings.HasPrefix(fingerprint.ProcessGuid, "docker") {
					lrp.DockerImageUrl = "some-image"
				}
				results = append(results, lrp)
			}

			desired := make(chan []cc_messages.DesireAppRequestFromCC, 1)
			desired <- results
			close(desired)

			errors := make(chan error, 1)
			close(errors)
开发者ID:emc-xchallenge,项目名称:nsync,代码行数:30,代码来源:processor_test.go



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang cc_messages.StagingRequestFromCC类代码示例发布时间:2022-05-23
下一篇:
Golang fake_bbs.FakeReceptorBBS类代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap