本文整理汇总了Golang中github.com/cloudfoundry-incubator/runtime-schema/cc_messages.DesireAppRequestFromCC.RoutingInfo方法的典型用法代码示例。如果您正苦于以下问题:Golang DesireAppRequestFromCC.RoutingInfo方法的具体用法?Golang DesireAppRequestFromCC.RoutingInfo怎么用?Golang DesireAppRequestFromCC.RoutingInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/cloudfoundry-incubator/runtime-schema/cc_messages.DesireAppRequestFromCC
的用法示例。
在下文中一共展示了DesireAppRequestFromCC.RoutingInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
Expect(runAction.Env).To(ContainElement(&models.EnvironmentVariable{
Name: "PORT",
Value: "8080",
}))
Expect(desiredLRP.EgressRules).To(ConsistOf(egressRules))
})
Context("when route service url is specified in RoutingInfo", func() {
BeforeEach(func() {
routingInfo, err := cc_messages.CCHTTPRoutes{
{Hostname: "route1"},
{Hostname: "route2", RouteServiceUrl: "https://rs.example.com"},
}.CCRouteInfo()
Expect(err).NotTo(HaveOccurred())
desiredAppReq.RoutingInfo = routingInfo
})
It("sets up routes with the route service url", func() {
routes := *desiredLRP.Routes
cfRoutesJson := routes[cfroutes.CF_ROUTER]
cfRoutes := cfroutes.CFRoutes{}
err := json.Unmarshal(*cfRoutesJson, &cfRoutes)
Expect(err).ToNot(HaveOccurred())
Expect(cfRoutes).To(ConsistOf([]cfroutes.CFRoute{
{Hostnames: []string{"route1"}, Port: 8080},
{Hostnames: []string{"route2"}, Port: 8080, RouteServiceUrl: "https://rs.example.com"},
}))
})
示例2:
Expect(buildpackBuilder.ExtractExposedPortsCallCount()).To(Equal(1))
Expect(buildpackBuilder.ExtractExposedPortsArgsForCall(0)).To(Equal(&desireAppRequest))
})
Context("when multiple routes with same route service are sent", func() {
var routesToEmit cfroutes.CFRoutes
BeforeEach(func() {
routingInfo, err := cc_messages.CCHTTPRoutes{
{Hostname: "route1", RouteServiceUrl: "https://rs.example.com"},
{Hostname: "route2", RouteServiceUrl: "https://rs.example.com"},
{Hostname: "route3"},
}.CCRouteInfo()
Expect(err).NotTo(HaveOccurred())
desireAppRequest.RoutingInfo = routingInfo
})
It("aggregates the http routes with the same route service url", func() {
routesToEmit = cfroutes.CFRoutes{
{Hostnames: []string{"route1", "route2"}, Port: 8080, RouteServiceUrl: "https://rs.example.com"},
{Hostnames: []string{"route3"}, Port: 8080},
}
opaqueRoutingDataCheck(routesToEmit)
})
})
Context("when multiple routes with different route service are sent", func() {
var routesToEmit cfroutes.CFRoutes
BeforeEach(func() {
routingInfo, err := cc_messages.CCHTTPRoutes{