本文整理匯總了Golang中bosh/agent/applier/applyspec.ApplySpec.Jobs方法的典型用法代碼示例。如果您正苦於以下問題:Golang ApplySpec.Jobs方法的具體用法?Golang ApplySpec.Jobs怎麽用?Golang ApplySpec.Jobs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類bosh/agent/applier/applyspec.ApplySpec
的用法示例。
在下文中一共展示了ApplySpec.Jobs方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Apply
func (s *concreteApplier) Apply(applySpec as.ApplySpec) error {
for _, job := range applySpec.Jobs() {
err := s.applyJob(job)
if err != nil {
return err
}
}
for _, pkg := range applySpec.Packages() {
err := s.packageApplier.Apply(pkg)
if err != nil {
return err
}
}
return s.setUpLogrotate(applySpec)
}
示例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
}
示例3: Apply
func (a *concreteApplier) Apply(applySpec as.ApplySpec) error {
err := a.jobSupervisor.RemoveAllJobs()
if err != nil {
return bosherr.WrapError(err, "Removing all jobs")
}
jobs := applySpec.Jobs()
for _, job := range jobs {
err = a.jobApplier.Apply(job)
if err != nil {
return bosherr.WrapError(err, "Applying job %s", job.Name)
}
}
for _, pkg := range applySpec.Packages() {
err = a.packageApplier.Apply(pkg)
if err != nil {
return bosherr.WrapError(err, "Applying package %s", pkg.Name)
}
}
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(applySpec)
}
示例4: Apply
func (a *concreteApplier) Apply(applySpec as.ApplySpec) (err error) {
jobs := applySpec.Jobs()
for _, job := range jobs {
err = a.jobApplier.Apply(job)
if err != nil {
err = bosherr.WrapError(err, "Applying job %s", job.Name)
return
}
}
for _, pkg := range applySpec.Packages() {
err = a.packageApplier.Apply(pkg)
if err != nil {
err = bosherr.WrapError(err, "Applying package %s", pkg.Name)
return
}
}
for i := 0; i < len(jobs); i++ {
job := jobs[len(jobs)-1-i]
err = a.jobApplier.Configure(job, i)
if err != nil {
err = bosherr.WrapError(err, "Configuring job %s", job.Name)
return
}
}
err = a.monitor.Reload()
if err != nil {
err = bosherr.WrapError(err, "Reloading monitor")
return
}
err = a.setUpLogrotate(applySpec)
return
}