本文整理匯總了Golang中github.com/nttlabs/cli/cf/models.DomainFields.Guid方法的典型用法代碼示例。如果您正苦於以下問題:Golang DomainFields.Guid方法的具體用法?Golang DomainFields.Guid怎麽用?Golang DomainFields.Guid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/nttlabs/cli/cf/models.DomainFields
的用法示例。
在下文中一共展示了DomainFields.Guid方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: ToModel
func (resource RouteSummary) ToModel() (route models.RouteSummary) {
domain := models.DomainFields{}
domain.Guid = resource.Domain.Guid
domain.Name = resource.Domain.Name
domain.Shared = resource.Domain.OwningOrganizationGuid != ""
route.Guid = resource.Guid
route.Host = resource.Host
route.Domain = domain
return
}
示例2:
Expect(handler).To(HaveAllRequestsCalled())
Expect(apiErr).NotTo(HaveOccurred())
})
It("finds a route by host and domain", func() {
ts, handler = testnet.NewServer([]testnet.TestRequest{
testapi.NewCloudControllerTestRequest(testnet.TestRequest{
Method: "GET",
Path: "/v2/routes?q=host%3Amy-cool-app%3Bdomain_guid%3Amy-domain-guid",
Response: findRouteByHostResponse,
}),
})
configRepo.SetApiEndpoint(ts.URL)
domain := models.DomainFields{}
domain.Guid = "my-domain-guid"
route, apiErr := repo.FindByHostAndDomain("my-cool-app", domain)
Expect(apiErr).NotTo(HaveOccurred())
Expect(handler).To(HaveAllRequestsCalled())
Expect(route.Host).To(Equal("my-cool-app"))
Expect(route.Guid).To(Equal("my-route-guid"))
Expect(route.Domain.Guid).To(Equal(domain.Guid))
})
It("returns 'not found' response when there is no route w/ the given domain and host", func() {
ts, handler = testnet.NewServer([]testnet.TestRequest{
testapi.NewCloudControllerTestRequest(testnet.TestRequest{
Method: "GET",
Path: "/v2/routes?q=host%3Amy-cool-app%3Bdomain_guid%3Amy-domain-guid",
示例3:
})
})
Context("when logged in and an org is targeted", func() {
BeforeEach(func() {
org := models.OrganizationFields{}
org.Name = "my-org"
app := models.ApplicationFields{}
app.Name = "app1"
app.Guid = "app1-guid"
apps := []models.ApplicationFields{app}
domain := models.DomainFields{}
domain.Name = "domain1"
domain.Guid = "domain1-guid"
domains := []models.DomainFields{domain}
serviceInstance := models.ServiceInstanceFields{}
serviceInstance.Name = "service1"
serviceInstance.Guid = "service1-guid"
services := []models.ServiceInstanceFields{serviceInstance}
securityGroup1 := models.SecurityGroupFields{Name: "Nacho Security"}
securityGroup2 := models.SecurityGroupFields{Name: "Nacho Prime"}
securityGroups := []models.SecurityGroupFields{securityGroup1, securityGroup2}
space := models.Space{}
space.Name = "whose-space-is-it-anyway"
space.Organization = org
space.Applications = apps