本文整理汇总了Golang中github.com/cloudfoundry/bosh-agent/platform/ntp.NewConcreteService函数的典型用法代码示例。如果您正苦于以下问题:Golang NewConcreteService函数的具体用法?Golang NewConcreteService怎么用?Golang NewConcreteService使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NewConcreteService函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: NewFactory
func NewFactory(
settingsService boshsettings.Service,
platform boshplatform.Platform,
blobstore boshblob.Blobstore,
taskService boshtask.Service,
notifier boshnotif.Notifier,
applier boshappl.Applier,
compiler boshcomp.Compiler,
jobSupervisor boshjobsuper.JobSupervisor,
specService boshas.V1Service,
jobScriptProvider boshscript.JobScriptProvider,
logger boshlog.Logger,
) (factory Factory) {
compressor := platform.GetCompressor()
copier := platform.GetCopier()
dirProvider := platform.GetDirProvider()
vitalsService := platform.GetVitalsService()
certManager := platform.GetCertManager()
ntpService := boshntp.NewConcreteService(platform.GetFs(), dirProvider)
factory = concreteFactory{
availableActions: map[string]Action{
// Task management
"ping": NewPing(),
"get_task": NewGetTask(taskService),
"cancel_task": NewCancelTask(taskService),
// VM admin
"ssh": NewSSH(settingsService, platform, dirProvider, logger),
"fetch_logs": NewFetchLogs(compressor, copier, blobstore, dirProvider),
"update_settings": NewUpdateSettings(certManager, logger),
// Job management
"prepare": NewPrepare(applier),
"apply": NewApply(applier, specService, settingsService),
"start": NewStart(jobSupervisor, applier, specService),
"stop": NewStop(jobSupervisor),
"drain": NewDrain(notifier, specService, jobScriptProvider, jobSupervisor, logger),
"get_state": NewGetState(settingsService, specService, jobSupervisor, vitalsService, ntpService),
"run_errand": NewRunErrand(specService, dirProvider.JobsDir(), platform.GetRunner(), logger),
"run_script": NewRunScript(jobScriptProvider, specService, logger),
// Compilation
"compile_package": NewCompilePackage(compiler),
"release_apply_spec": NewReleaseApplySpec(platform),
// Disk management
"list_disk": NewListDisk(settingsService, platform, logger),
"migrate_disk": NewMigrateDisk(platform, dirProvider),
"mount_disk": NewMountDisk(settingsService, platform, platform.GetDevicePathResolver(), dirProvider, logger),
"unmount_disk": NewUnmountDisk(settingsService, platform),
// Networkingconcrete_factory_test.go
"prepare_network_change": NewPrepareNetworkChange(platform.GetFs(), settingsService, NewAgentKiller()),
"prepare_configure_networks": NewPrepareConfigureNetworks(platform, settingsService),
"configure_networks": NewConfigureNetworks(NewAgentKiller()),
},
}
return
}
开发者ID:EMC-CMD,项目名称:bosh-agent,代码行数:60,代码来源:concrete_factory.go
示例2:
})
It("get_task", func() {
action, err := factory.Create("get_task")
Expect(err).ToNot(HaveOccurred())
Expect(action).To(Equal(NewGetTask(taskService)))
})
It("cancel_task", func() {
action, err := factory.Create("cancel_task")
Expect(err).ToNot(HaveOccurred())
Expect(action).To(Equal(NewCancelTask(taskService)))
})
It("get_state", func() {
ntpService := boshntp.NewConcreteService(platform.GetFs(), platform.GetDirProvider())
action, err := factory.Create("get_state")
Expect(err).ToNot(HaveOccurred())
Expect(action).To(Equal(NewGetState(settingsService, specService, jobSupervisor, platform.GetVitalsService(), ntpService)))
})
It("list_disk", func() {
action, err := factory.Create("list_disk")
Expect(err).ToNot(HaveOccurred())
Expect(action).To(Equal(NewListDisk(settingsService, platform, logger)))
})
It("migrate_disk", func() {
action, err := factory.Create("migrate_disk")
Expect(err).ToNot(HaveOccurred())
Expect(action).To(Equal(NewMigrateDisk(platform, platform.GetDirProvider())))
开发者ID:gu-bin,项目名称:bosh-agent,代码行数:31,代码来源:concrete_factory_test.go
注:本文中的github.com/cloudfoundry/bosh-agent/platform/ntp.NewConcreteService函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论