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


Golang AppRoutes.HostnamesByPort方法代码示例

本文整理汇总了Golang中github.com/cloudfoundry-incubator/lattice/ltc/route_helpers.AppRoutes.HostnamesByPort方法的典型用法代码示例。如果您正苦于以下问题:Golang AppRoutes.HostnamesByPort方法的具体用法?Golang AppRoutes.HostnamesByPort怎么用?Golang AppRoutes.HostnamesByPort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/cloudfoundry-incubator/lattice/ltc/route_helpers.AppRoutes的用法示例。


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

示例1:

				}

				Consistently(appRoutesFromRoutingInfo).Should(Panic(), "invalid json.RawMessage ought to panic")
			})
		})
	})

	Describe("HostnamesByPort", func() {
		It("returns map of ports to slice of hostnames", func() {
			expectedHostnamesByPort := map[uint16][]string{
				11111: []string{"foo1.example.com", "bar1.examaple.com"},
				22222: []string{"foo2.example.com", "bar2.examaple.com"},
				33333: []string{"foo3.example.com", "bar3.examaple.com"},
			}

			Expect(appRoutes.HostnamesByPort()).To(Equal(expectedHostnamesByPort))
		})
	})

	Describe("Routes", func() {

		var (
			routes               route_helpers.Routes
			tcpRoute1, tcpRoute2 route_helpers.TcpRoute
			diegoSSHRoute        *route_helpers.DiegoSSHRoute
		)

		BeforeEach(func() {
			tcpRoute1 = route_helpers.TcpRoute{
				ExternalPort: 50000,
				Port:         5222,
开发者ID:davidwadden,项目名称:lattice-release,代码行数:31,代码来源:route_helpers_test.go


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