本文整理匯總了Golang中bosh/settings/directories.DirectoriesProvider.SettingsDir方法的典型用法代碼示例。如果您正苦於以下問題:Golang DirectoriesProvider.SettingsDir方法的具體用法?Golang DirectoriesProvider.SettingsDir怎麽用?Golang DirectoriesProvider.SettingsDir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類bosh/settings/directories.DirectoriesProvider
的用法示例。
在下文中一共展示了DirectoriesProvider.SettingsDir方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: NewProvider
func NewProvider(logger boshlog.Logger, dirProvider boshdirs.DirectoriesProvider) (p provider) {
runner := boshsys.NewExecCmdRunner(logger)
fs := boshsys.NewOsFileSystem(logger, runner)
sigarCollector := boshstats.NewSigarStatsCollector()
linuxDiskManager := boshdisk.NewLinuxDiskManager(logger, runner, fs)
udev := boshudev.NewConcreteUdevDevice(runner)
linuxCdrom := boshcdrom.NewLinuxCdrom("/dev/sr0", udev, runner)
linuxCdutil := boshcd.NewCdUtil(dirProvider.SettingsDir(), fs, linuxCdrom)
compressor := boshcmd.NewTarballCompressor(runner, fs)
copier := boshcmd.NewCpCopier(runner, fs)
vitalsService := boshvitals.NewService(sigarCollector, dirProvider)
centosNetManager := boshnet.NewCentosNetManager(fs, runner, 10*time.Second)
ubuntuNetManager := boshnet.NewUbuntuNetManager(fs, runner, 10*time.Second)
centos := NewLinuxPlatform(
fs,
runner,
sigarCollector,
compressor,
copier,
dirProvider,
vitalsService,
linuxCdutil,
linuxDiskManager,
centosNetManager,
500*time.Millisecond,
logger,
)
ubuntu := NewLinuxPlatform(
fs,
runner,
sigarCollector,
compressor,
copier,
dirProvider,
vitalsService,
linuxCdutil,
linuxDiskManager,
ubuntuNetManager,
500*time.Millisecond,
logger,
)
p.platforms = map[string]Platform{
"ubuntu": ubuntu,
"centos": centos,
"dummy": NewDummyPlatform(sigarCollector, fs, runner, dirProvider, linuxDiskManager),
}
return
}
示例2: NewProvider
func NewProvider(logger boshlog.Logger, dirProvider boshdirs.DirectoriesProvider, options ProviderOptions) (p provider) {
runner := boshsys.NewExecCmdRunner(logger)
fs := boshsys.NewOsFileSystem(logger)
linuxDiskManager := boshdisk.NewLinuxDiskManager(logger, runner, fs, options.Linux.BindMountPersistentDisk)
udev := boshudev.NewConcreteUdevDevice(runner)
linuxCdrom := boshcdrom.NewLinuxCdrom("/dev/sr0", udev, runner)
linuxCdutil := boshcd.NewCdUtil(dirProvider.SettingsDir(), fs, linuxCdrom)
compressor := boshcmd.NewTarballCompressor(runner, fs)
copier := boshcmd.NewCpCopier(runner, fs, logger)
sigarCollector := boshstats.NewSigarStatsCollector(&sigar.ConcreteSigar{})
// Kick of stats collection as soon as possible
go sigarCollector.StartCollecting(SigarStatsCollectionInterval, nil)
vitalsService := boshvitals.NewService(sigarCollector, dirProvider)
routesSearcher := boshnet.NewCmdRoutesSearcher(runner)
ipResolver := boship.NewIPResolver(boship.NetworkInterfaceToAddrsFunc)
defaultNetworkResolver := boshnet.NewDefaultNetworkResolver(routesSearcher, ipResolver)
arping := bosharp.NewArping(runner, fs, logger, ArpIterations, ArpIterationDelay, ArpInterfaceCheckDelay)
centosNetManager := boshnet.NewCentosNetManager(fs, runner, defaultNetworkResolver, ipResolver, arping, logger)
ubuntuNetManager := boshnet.NewUbuntuNetManager(fs, runner, defaultNetworkResolver, ipResolver, arping, logger)
centos := NewLinuxPlatform(
fs,
runner,
sigarCollector,
compressor,
copier,
dirProvider,
vitalsService,
linuxCdutil,
linuxDiskManager,
centosNetManager,
500*time.Millisecond,
options.Linux,
logger,
)
ubuntu := NewLinuxPlatform(
fs,
runner,
sigarCollector,
compressor,
copier,
dirProvider,
vitalsService,
linuxCdutil,
linuxDiskManager,
ubuntuNetManager,
500*time.Millisecond,
options.Linux,
logger,
)
p.platforms = map[string]Platform{
"ubuntu": ubuntu,
"centos": centos,
"dummy": NewDummyPlatform(sigarCollector, fs, runner, dirProvider, logger),
}
return
}
示例3: NewProvider
func NewProvider(logger boshlog.Logger, dirProvider boshdirs.DirectoriesProvider, options ProviderOptions) (p provider) {
runner := boshsys.NewExecCmdRunner(logger)
fs := boshsys.NewOsFileSystem(logger)
linuxDiskManager := boshdisk.NewLinuxDiskManager(logger, runner, fs, options.Linux.BindMountPersistentDisk)
udev := boshudev.NewConcreteUdevDevice(runner)
linuxCdrom := boshcdrom.NewLinuxCdrom("/dev/sr0", udev, runner)
linuxCdutil := boshcd.NewCdUtil(dirProvider.SettingsDir(), fs, linuxCdrom)
compressor := boshcmd.NewTarballCompressor(runner, fs)
copier := boshcmd.NewCpCopier(runner, fs, logger)
sigarCollector := boshstats.NewSigarStatsCollector()
vitalsService := boshvitals.NewService(sigarCollector, dirProvider)
routesSearcher := boshnet.NewCmdRoutesSearcher(runner)
defaultNetworkResolver := boshnet.NewDefaultNetworkResolver(
routesSearcher,
boshnet.DefaultInterfaceToAddrsFunc,
)
centosNetManager := boshnet.NewCentosNetManager(fs, runner, defaultNetworkResolver, 10*time.Second, logger)
ubuntuNetManager := boshnet.NewUbuntuNetManager(fs, runner, defaultNetworkResolver, 10*time.Second, logger)
centos := NewLinuxPlatform(
fs,
runner,
sigarCollector,
compressor,
copier,
dirProvider,
vitalsService,
linuxCdutil,
linuxDiskManager,
centosNetManager,
500*time.Millisecond,
options.Linux,
logger,
)
ubuntu := NewLinuxPlatform(
fs,
runner,
sigarCollector,
compressor,
copier,
dirProvider,
vitalsService,
linuxCdutil,
linuxDiskManager,
ubuntuNetManager,
500*time.Millisecond,
options.Linux,
logger,
)
p.platforms = map[string]Platform{
"ubuntu": ubuntu,
"centos": centos,
"dummy": NewDummyPlatform(sigarCollector, fs, runner, dirProvider, linuxDiskManager, logger),
}
return
}