本文整理匯總了Golang中github.com/cloudfoundry/cli/cf/actors.NewPushActor函數的典型用法代碼示例。如果您正苦於以下問題:Golang NewPushActor函數的具體用法?Golang NewPushActor怎麽用?Golang NewPushActor使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了NewPushActor函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: NewFactory
//.........這裏部分代碼省略.........
repoLocator.GetSpaceRepository(),
repoLocator.GetOrganizationRepository(),
repoLocator.GetSecurityGroupSpaceBinder(),
)
factory.cmdsByName["unbind-security-group"] = securitygroup.NewUnbindSecurityGroup(ui, config, repoLocator.GetSecurityGroupRepository(), repoLocator.GetOrganizationRepository(), repoLocator.GetSpaceRepository(), repoLocator.GetSecurityGroupSpaceBinder())
createRoute := route.NewCreateRoute(ui, config, repoLocator.GetRouteRepository())
factory.cmdsByName["create-route"] = createRoute
factory.cmdsByName["map-route"] = route.NewMapRoute(ui, config, repoLocator.GetRouteRepository(), createRoute)
factory.cmdsByName["unmap-route"] = route.NewUnmapRoute(ui, config, repoLocator.GetRouteRepository())
displayApp := application.NewShowApp(ui, config, repoLocator.GetAppSummaryRepository(), repoLocator.GetAppInstancesRepository())
start := application.NewStart(ui, config, displayApp, repoLocator.GetApplicationRepository(), repoLocator.GetAppInstancesRepository(), repoLocator.GetLogsRepository())
stop := application.NewStop(ui, config, repoLocator.GetApplicationRepository())
restart := application.NewRestart(ui, start, stop)
restage := application.NewRestage(ui, config, repoLocator.GetApplicationRepository(), start)
bind := service.NewBindService(ui, config, repoLocator.GetServiceBindingRepository())
factory.cmdsByName["app"] = displayApp
factory.cmdsByName["bind-service"] = bind
factory.cmdsByName["start"] = start
factory.cmdsByName["stop"] = stop
factory.cmdsByName["restart"] = restart
factory.cmdsByName["restage"] = restage
factory.cmdsByName["push"] = application.NewPush(
ui, config, manifestRepo, start, stop, bind,
repoLocator.GetApplicationRepository(),
repoLocator.GetDomainRepository(),
repoLocator.GetRouteRepository(),
repoLocator.GetStackRepository(),
repoLocator.GetServiceRepository(),
repoLocator.GetAuthenticationRepository(),
words.NewWordGenerator(),
actors.NewPushActor(repoLocator.GetApplicationBitsRepository(), app_files.ApplicationZipper{}, app_files.ApplicationFiles{}),
app_files.ApplicationZipper{},
app_files.ApplicationFiles{})
factory.cmdsByName["scale"] = application.NewScale(ui, config, restart, repoLocator.GetApplicationRepository())
spaceRoleSetter := user.NewSetSpaceRole(ui, config, repoLocator.GetSpaceRepository(), repoLocator.GetUserRepository())
factory.cmdsByName["set-space-role"] = spaceRoleSetter
factory.cmdsByName["create-space"] = space.NewCreateSpace(ui, config, spaceRoleSetter, repoLocator.GetSpaceRepository(), repoLocator.GetOrganizationRepository(), repoLocator.GetUserRepository())
planBuilder := plan_builder.NewBuilder(
repoLocator.GetServicePlanRepository(),
repoLocator.GetServicePlanVisibilityRepository(),
repoLocator.GetOrganizationRepository(),
)
serviceBuilder := service_builder.NewBuilder(
repoLocator.GetServiceRepository(),
planBuilder,
)
brokerBuilder := broker_builder.NewBuilder(
repoLocator.GetServiceBrokerRepository(),
serviceBuilder,
)
factory.cmdsByName["service-access"] = serviceaccess.NewServiceAccess(
ui, config,
actors.NewServiceHandler(
repoLocator.GetOrganizationRepository(),
brokerBuilder,
serviceBuilder,
),
示例2:
var (
appBitsRepo *fakeBits.FakeApplicationBitsRepository
appFiles *fakes.FakeAppFiles
fakezipper *fakes.FakeZipper
actor actors.PushActor
fixturesDir string
appDir string
allFiles []models.AppFileFields
presentFiles []resources.AppFileResource
)
BeforeEach(func() {
appBitsRepo = &fakeBits.FakeApplicationBitsRepository{}
appFiles = &fakes.FakeAppFiles{}
fakezipper = &fakes.FakeZipper{}
actor = actors.NewPushActor(appBitsRepo, fakezipper, appFiles)
fixturesDir = filepath.Join("..", "..", "fixtures", "applications")
allFiles = []models.AppFileFields{
models.AppFileFields{Path: "example-app/.cfignore"},
models.AppFileFields{Path: "example-app/app.rb"},
models.AppFileFields{Path: "example-app/config.ru"},
models.AppFileFields{Path: "example-app/Gemfile"},
models.AppFileFields{Path: "example-app/Gemfile.lock"},
models.AppFileFields{Path: "example-app/ignore-me"},
models.AppFileFields{Path: "example-app/manifest.yml"},
}
})
Describe("GatherFiles", func() {
var tmpDir string
示例3: NewFactory
//.........這裏部分代碼省略.........
repoLocator.GetSecurityGroupRepository(),
repoLocator.GetSpaceRepository(),
repoLocator.GetOrganizationRepository(),
repoLocator.GetSecurityGroupSpaceBinder(),
)
factory.cmdsByName["unbind-security-group"] = securitygroup.NewUnbindSecurityGroup(ui, config, repoLocator.GetSecurityGroupRepository(), repoLocator.GetOrganizationRepository(), repoLocator.GetSpaceRepository(), repoLocator.GetSecurityGroupSpaceBinder())
createRoute := route.NewCreateRoute(ui, config, repoLocator.GetRouteRepository())
factory.cmdsByName["create-route"] = createRoute
factory.cmdsByName["map-route"] = route.NewMapRoute(ui, config, repoLocator.GetRouteRepository(), createRoute)
displayApp := application.NewShowApp(ui, config, repoLocator.GetAppSummaryRepository(), repoLocator.GetAppInstancesRepository(), repoLocator.GetLogsNoaaRepository())
start := application.NewStart(ui, config, displayApp, repoLocator.GetApplicationRepository(), repoLocator.GetAppInstancesRepository(), repoLocator.GetLogsNoaaRepository(), repoLocator.GetOldLogsRepository())
stop := application.NewStop(ui, config, repoLocator.GetApplicationRepository())
restart := application.NewRestart(ui, config, start, stop)
restage := application.NewRestage(ui, config, repoLocator.GetApplicationRepository(), start)
bind := service.NewBindService(ui, config, repoLocator.GetServiceBindingRepository())
factory.cmdsByName["bind-service"] = bind
factory.cmdsByName["start"] = start
factory.cmdsByName["stop"] = stop
factory.cmdsByName["restart"] = restart
factory.cmdsByName["restart-app-instance"] = application.NewRestartAppInstance(ui, config, repoLocator.GetAppInstancesRepository())
factory.cmdsByName["restage"] = restage
factory.cmdsByName["push"] = application.NewPush(
ui, config, manifestRepo, start, stop, bind,
repoLocator.GetApplicationRepository(),
repoLocator.GetDomainRepository(),
repoLocator.GetRouteRepository(),
repoLocator.GetStackRepository(),
repoLocator.GetServiceRepository(),
repoLocator.GetAuthenticationRepository(),
generator.NewWordGenerator(),
actors.NewPushActor(repoLocator.GetApplicationBitsRepository(), app_files.ApplicationZipper{}, app_files.ApplicationFiles{}),
app_files.ApplicationZipper{},
app_files.ApplicationFiles{})
factory.cmdsByName["scale"] = application.NewScale(ui, config, restart, repoLocator.GetApplicationRepository())
spaceRoleSetter := user.NewSetSpaceRole(ui, config, repoLocator.GetSpaceRepository(), repoLocator.GetUserRepository())
factory.cmdsByName["set-space-role"] = spaceRoleSetter
factory.cmdsByName["create-space"] = space.NewCreateSpace(ui, config, spaceRoleSetter, repoLocator.GetSpaceRepository(), repoLocator.GetOrganizationRepository(), repoLocator.GetUserRepository(), repoLocator.GetSpaceQuotaRepository())
factory.cmdsByName["service-access"] = serviceaccess.NewServiceAccess(
ui, config,
actors.NewServiceHandler(
repoLocator.GetOrganizationRepository(),
brokerBuilder,
serviceBuilder,
),
repoLocator.GetAuthenticationRepository(),
)
factory.cmdsByName["enable-service-access"] = serviceaccess.NewEnableServiceAccess(
ui, config,
actors.NewServicePlanHandler(
repoLocator.GetServicePlanRepository(),
repoLocator.GetServicePlanVisibilityRepository(),
repoLocator.GetOrganizationRepository(),
planBuilder,
serviceBuilder,
),
repoLocator.GetAuthenticationRepository(),
)
factory.cmdsByName["disable-service-access"] = serviceaccess.NewDisableServiceAccess(
ui, config,
actors.NewServicePlanHandler(
示例4: NewDependency
func NewDependency(logger trace.Printer) Dependency {
deps := Dependency{}
deps.TeePrinter = terminal.NewTeePrinter()
deps.Ui = terminal.NewUI(os.Stdin, deps.TeePrinter, logger)
errorHandler := func(err error) {
if err != nil {
deps.Ui.Failed(fmt.Sprintf("Config error: %s", err))
}
}
deps.Config = core_config.NewRepositoryFromFilepath(config_helpers.DefaultFilePath(), errorHandler)
deps.ManifestRepo = manifest.NewManifestDiskRepository()
deps.AppManifest = manifest.NewGenerator()
deps.PluginConfig = plugin_config.NewPluginConfig(errorHandler)
terminal.UserAskedForColors = deps.Config.ColorEnabled()
terminal.InitColorSupport()
deps.Gateways = map[string]net.Gateway{
"cloud-controller": net.NewCloudControllerGateway(deps.Config, time.Now, deps.Ui, logger),
"uaa": net.NewUAAGateway(deps.Config, deps.Ui, logger),
"routing-api": net.NewRoutingApiGateway(deps.Config, time.Now, deps.Ui, logger),
}
deps.RepoLocator = api.NewRepositoryLocator(deps.Config, deps.Gateways, logger)
deps.PluginModels = &PluginModels{Application: nil}
deps.PlanBuilder = plan_builder.NewBuilder(
deps.RepoLocator.GetServicePlanRepository(),
deps.RepoLocator.GetServicePlanVisibilityRepository(),
deps.RepoLocator.GetOrganizationRepository(),
)
deps.ServiceBuilder = service_builder.NewBuilder(
deps.RepoLocator.GetServiceRepository(),
deps.PlanBuilder,
)
deps.BrokerBuilder = broker_builder.NewBuilder(
deps.RepoLocator.GetServiceBrokerRepository(),
deps.ServiceBuilder,
)
deps.PluginRepo = plugin_repo.NewPluginRepo()
deps.ServiceHandler = actors.NewServiceHandler(
deps.RepoLocator.GetOrganizationRepository(),
deps.BrokerBuilder,
deps.ServiceBuilder,
)
deps.ServicePlanHandler = actors.NewServicePlanHandler(
deps.RepoLocator.GetServicePlanRepository(),
deps.RepoLocator.GetServicePlanVisibilityRepository(),
deps.RepoLocator.GetOrganizationRepository(),
deps.PlanBuilder,
deps.ServiceBuilder,
)
deps.WordGenerator = generator.NewWordGenerator()
deps.AppZipper = app_files.ApplicationZipper{}
deps.AppFiles = app_files.ApplicationFiles{}
deps.PushActor = actors.NewPushActor(deps.RepoLocator.GetApplicationBitsRepository(), deps.AppZipper, deps.AppFiles)
deps.ChecksumUtil = utils.NewSha1Checksum("")
deps.Logger = logger
return deps
}
示例5: NewDependency
func NewDependency(writer io.Writer, logger trace.Printer) Dependency {
deps := Dependency{}
deps.TeePrinter = terminal.NewTeePrinter(writer)
deps.UI = terminal.NewUI(os.Stdin, writer, deps.TeePrinter, logger)
errorHandler := func(err error) {
if err != nil {
deps.UI.Failed(fmt.Sprintf("Config error: %s", err))
}
}
configPath, err := confighelpers.DefaultFilePath()
if err != nil {
errorHandler(err)
}
deps.Config = coreconfig.NewRepositoryFromFilepath(configPath, errorHandler)
deps.ManifestRepo = manifest.NewDiskRepository()
deps.AppManifest = manifest.NewGenerator()
pluginPath := filepath.Join(confighelpers.PluginRepoDir(), ".cf", "plugins")
deps.PluginConfig = pluginconfig.NewPluginConfig(
errorHandler,
configuration.NewDiskPersistor(filepath.Join(pluginPath, "config.json")),
pluginPath,
)
terminal.UserAskedForColors = deps.Config.ColorEnabled()
terminal.InitColorSupport()
deps.Gateways = map[string]net.Gateway{
"cloud-controller": net.NewCloudControllerGateway(deps.Config, time.Now, deps.UI, logger),
"uaa": net.NewUAAGateway(deps.Config, deps.UI, logger),
"routing-api": net.NewRoutingAPIGateway(deps.Config, time.Now, deps.UI, logger),
}
deps.RepoLocator = api.NewRepositoryLocator(deps.Config, deps.Gateways, logger)
deps.PluginModels = &PluginModels{Application: nil}
deps.PlanBuilder = planbuilder.NewBuilder(
deps.RepoLocator.GetServicePlanRepository(),
deps.RepoLocator.GetServicePlanVisibilityRepository(),
deps.RepoLocator.GetOrganizationRepository(),
)
deps.ServiceBuilder = servicebuilder.NewBuilder(
deps.RepoLocator.GetServiceRepository(),
deps.PlanBuilder,
)
deps.BrokerBuilder = brokerbuilder.NewBuilder(
deps.RepoLocator.GetServiceBrokerRepository(),
deps.ServiceBuilder,
)
deps.PluginRepo = pluginrepo.NewPluginRepo()
deps.ServiceHandler = actors.NewServiceHandler(
deps.RepoLocator.GetOrganizationRepository(),
deps.BrokerBuilder,
deps.ServiceBuilder,
)
deps.ServicePlanHandler = actors.NewServicePlanHandler(
deps.RepoLocator.GetServicePlanRepository(),
deps.RepoLocator.GetServicePlanVisibilityRepository(),
deps.RepoLocator.GetOrganizationRepository(),
deps.PlanBuilder,
deps.ServiceBuilder,
)
deps.WordGenerator = generator.NewWordGenerator()
deps.AppZipper = appfiles.ApplicationZipper{}
deps.AppFiles = appfiles.ApplicationFiles{}
deps.PushActor = actors.NewPushActor(deps.RepoLocator.GetApplicationBitsRepository(), deps.AppZipper, deps.AppFiles)
deps.ChecksumUtil = utils.NewSha1Checksum("")
deps.Logger = logger
return deps
}