本文整理匯總了Golang中github.com/cloudfoundry/cli/cf/models.DomainFields.Name方法的典型用法代碼示例。如果您正苦於以下問題:Golang DomainFields.Name方法的具體用法?Golang DomainFields.Name怎麽用?Golang DomainFields.Name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/cloudfoundry/cli/cf/models.DomainFields
的用法示例。
在下文中一共展示了DomainFields.Name方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: makeAppWithOptions
func makeAppWithOptions(appName string) models.Application {
application := models.Application{}
application.Name = appName
application.Guid = "app-guid"
application.Command = "run main.go"
application.BuildpackUrl = "go-buildpack"
domain := models.DomainFields{}
domain.Name = "example.com"
route := models.RouteSummary{Host: "foo", Domain: domain}
secondRoute := models.RouteSummary{Host: appName, Domain: domain}
packgeUpdatedAt, _ := time.Parse("2006-01-02T15:04:05Z07:00", "2012-10-24T19:54:00Z")
application.State = "started"
application.InstanceCount = 2
application.RunningInstances = 2
application.Memory = 256
application.HealthCheckTimeout = 100
application.Routes = []models.RouteSummary{route, secondRoute}
application.PackageUpdatedAt = &packgeUpdatedAt
envMap := make(map[string]interface{})
envMap["foo"] = "bar"
application.EnvironmentVars = envMap
application.Services = append(application.Services, models.ServicePlanSummary{
Guid: "",
Name: "server1",
})
return application
}
示例2: makeAppWithRoute
func makeAppWithRoute(appName string) models.Application {
application := models.Application{}
application.Name = appName
application.Guid = "app-guid"
domain := models.DomainFields{}
domain.Name = "example.com"
route := models.RouteSummary{Host: "foo", Domain: domain}
secondRoute := models.RouteSummary{Host: appName, Domain: domain}
packgeUpdatedAt, _ := time.Parse("2006-01-02T15:04:05Z07:00", "2012-10-24T19:54:00Z")
application.State = "started"
application.InstanceCount = 2
application.RunningInstances = 2
application.Memory = 256
application.Stack = &models.Stack{
Name: "fake_stack",
Guid: "123-123-123",
}
application.Routes = []models.RouteSummary{route, secondRoute}
application.PackageUpdatedAt = &packgeUpdatedAt
return application
}
示例3: fakeDomainRepo
func fakeDomainRepo() *testapi.FakeDomainRepository {
domain := models.DomainFields{}
domain.Name = "foo.com"
domain.Guid = "foo-guid"
domain.Shared = true
return &testapi.FakeDomainRepository{
FindByNameInOrgDomain: domain,
}
}
示例4: 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
}
示例5: 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.Path = resource.Path
route.Port = resource.Port
route.Domain = domain
return
}
示例6: makeAppWithRoute
func makeAppWithRoute(appName string) models.Application {
application := models.Application{}
application.Name = appName
application.Guid = "app-guid"
domain := models.DomainFields{}
domain.Name = "example.com"
route := models.RouteSummary{Host: "foo", Domain: domain}
secondRoute := models.RouteSummary{Host: appName, Domain: domain}
application.State = "started"
application.InstanceCount = 2
application.RunningInstances = 2
application.Memory = 256
application.Routes = []models.RouteSummary{route, secondRoute}
return application
}
示例7:
Expect(testcmd.CommandDidPassRequirements).To(BeFalse())
})
})
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
示例8:
displayApp = &appCmdFakes.FakeAppDisplayer{}
//save original command dependency and restore later
OriginalAppCommand = command_registry.Commands.FindCommand("app")
defaultInstanceErrorCodes = []string{"", ""}
defaultAppForStart = models.Application{}
defaultAppForStart.Name = "my-app"
defaultAppForStart.Guid = "my-app-guid"
defaultAppForStart.InstanceCount = 2
defaultAppForStart.PackageState = "STAGED"
domain := models.DomainFields{}
domain.Name = "example.com"
route := models.RouteSummary{}
route.Host = "my-app"
route.Domain = domain
defaultAppForStart.Routes = []models.RouteSummary{route}
instance1 := models.AppInstanceFields{}
instance1.State = models.InstanceStarting
instance2 := models.AppInstanceFields{}
instance2.State = models.InstanceStarting
instance3 := models.AppInstanceFields{}
instance3.State = models.InstanceRunning
示例9:
args := []string{"my-org"}
ui := callShowOrg(args, requirementsFactory)
Expect(ui.FailedWithUsage).To(BeFalse())
args = []string{}
ui = callShowOrg(args, requirementsFactory)
Expect(ui.FailedWithUsage).To(BeTrue())
})
It("TestRunWhenOrganizationExists", func() {
developmentSpaceFields := models.SpaceFields{}
developmentSpaceFields.Name = "development"
stagingSpaceFields := models.SpaceFields{}
stagingSpaceFields.Name = "staging"
domainFields := models.DomainFields{}
domainFields.Name = "cfapps.io"
cfAppDomainFields := models.DomainFields{}
cfAppDomainFields.Name = "cf-app.com"
org := models.Organization{}
org.Name = "my-org"
org.Guid = "my-org-guid"
org.QuotaDefinition = models.NewQuotaFields("cantina-quota", 512, 2, 5, true)
org.Spaces = []models.SpaceFields{developmentSpaceFields, stagingSpaceFields}
org.Domains = []models.DomainFields{domainFields, cfAppDomainFields}
requirementsFactory := &testreq.FakeReqFactory{Organization: org, LoginSuccess: true}
args := []string{"my-org"}
ui := callShowOrg(args, requirementsFactory)
Expect(requirementsFactory.OrganizationName).To(Equal("my-org"))
示例10:
})
It("TestMapRouteRequirements", func() {
routeRepo := &testapi.FakeRouteRepository{}
requirementsFactory := &testreq.FakeReqFactory{LoginSuccess: true}
callMapRoute([]string{"-n", "my-host", "my-app", "my-domain.com"}, requirementsFactory, routeRepo, &testcmd.FakeRouteCreator{})
Expect(testcmd.CommandDidPassRequirements).To(BeTrue())
Expect(requirementsFactory.ApplicationName).To(Equal("my-app"))
Expect(requirementsFactory.DomainName).To(Equal("my-domain.com"))
})
It("TestMapRouteWhenBinding", func() {
domain := models.DomainFields{}
domain.Guid = "my-domain-guid"
domain.Name = "example.com"
route := models.Route{}
route.Guid = "my-route-guid"
route.Host = "foo"
route.Domain = domain
app := models.Application{}
app.Guid = "my-app-guid"
app.Name = "my-app"
routeRepo := &testapi.FakeRouteRepository{}
requirementsFactory := &testreq.FakeReqFactory{LoginSuccess: true, Application: app, Domain: domain}
routeCreator := &testcmd.FakeRouteCreator{ReservedRoute: route}
ui := callMapRoute([]string{"-n", "my-host", "my-app", "my-domain.com"}, requirementsFactory, routeRepo, routeCreator)