當前位置: 首頁>>代碼示例>>Golang>>正文


Golang applyspec.ApplySpec類代碼示例

本文整理匯總了Golang中github.com/cloudfoundry/bosh-agent/agent/applier/applyspec.ApplySpec的典型用法代碼示例。如果您正苦於以下問題:Golang ApplySpec類的具體用法?Golang ApplySpec怎麽用?Golang ApplySpec使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ApplySpec類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: setUpLogrotate

func (a *concreteApplier) setUpLogrotate(applySpec as.ApplySpec) error {
	err := a.logrotateDelegate.SetupLogrotate(
		boshsettings.VCAPUsername,
		a.dirProvider.BaseDir(),
		applySpec.MaxLogFileSize(),
	)
	if err != nil {
		return bosherr.WrapError(err, "Logrotate setup failed")
	}

	return nil
}
開發者ID:keaty,項目名稱:bosh-provisioner,代碼行數:12,代碼來源:concrete_applier.go

示例2: Prepare

func (a *concreteApplier) Prepare(desiredApplySpec as.ApplySpec) error {
	for _, job := range desiredApplySpec.Jobs() {
		err := a.jobApplier.Prepare(job)
		if err != nil {
			return bosherr.WrapError(err, "Preparing job %s", job.Name)
		}
	}

	for _, pkg := range desiredApplySpec.Packages() {
		err := a.packageApplier.Prepare(pkg)
		if err != nil {
			return bosherr.WrapError(err, "Preparing package %s", pkg.Name)
		}
	}

	return nil
}
開發者ID:keaty,項目名稱:bosh-provisioner,代碼行數:17,代碼來源:concrete_applier.go

示例3: ConfigureJobs

func (a *concreteApplier) ConfigureJobs(desiredApplySpec as.ApplySpec) error {

	jobs := desiredApplySpec.Jobs()
	for i := 0; i < len(jobs); i++ {
		job := jobs[len(jobs)-1-i]

		err := a.jobApplier.Configure(job, i)
		if err != nil {
			return bosherr.WrapErrorf(err, "Configuring job %s", job.Name)
		}
	}

	err := a.jobSupervisor.Reload()
	if err != nil {
		return bosherr.WrapError(err, "Reloading jobSupervisor")
	}

	return nil
}
開發者ID:EMC-CMD,項目名稱:bosh-agent,代碼行數:19,代碼來源:concrete_applier.go

示例4: Apply

func (a *concreteApplier) Apply(currentApplySpec, desiredApplySpec as.ApplySpec) error {
	err := a.jobSupervisor.RemoveAllJobs()
	if err != nil {
		return bosherr.WrapError(err, "Removing all jobs")
	}

	jobs := desiredApplySpec.Jobs()
	for _, job := range jobs {
		err = a.jobApplier.Apply(job)
		if err != nil {
			return bosherr.WrapError(err, "Applying job %s", job.Name)
		}
	}

	err = a.jobApplier.KeepOnly(append(currentApplySpec.Jobs(), desiredApplySpec.Jobs()...))
	if err != nil {
		return bosherr.WrapError(err, "Keeping only needed jobs")
	}

	for _, pkg := range desiredApplySpec.Packages() {
		err = a.packageApplier.Apply(pkg)
		if err != nil {
			return bosherr.WrapError(err, "Applying package %s", pkg.Name)
		}
	}

	err = a.packageApplier.KeepOnly(append(currentApplySpec.Packages(), desiredApplySpec.Packages()...))
	if err != nil {
		return bosherr.WrapError(err, "Keeping only needed packages")
	}

	for i := 0; i < len(jobs); i++ {
		job := jobs[len(jobs)-1-i]

		err = a.jobApplier.Configure(job, i)
		if err != nil {
			return bosherr.WrapError(err, "Configuring job %s", job.Name)
		}
	}

	err = a.jobSupervisor.Reload()
	if err != nil {
		return bosherr.WrapError(err, "Reloading jobSupervisor")
	}

	return a.setUpLogrotate(desiredApplySpec)
}
開發者ID:keaty,項目名稱:bosh-provisioner,代碼行數:47,代碼來源:concrete_applier.go


注:本文中的github.com/cloudfoundry/bosh-agent/agent/applier/applyspec.ApplySpec類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。