本文整理匯總了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,