func (r ServiceMap) AppendSysResource(sr string, sys *system.System, config util.Config) (*Service, error) { sysres := sys.NewService(sr, sys, config) res, err := NewService(sysres, config) if err != nil { return nil, err } r[res.ID()] = res return res, nil }
func (r ServiceMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Service, system.Service, bool) { sysres := sys.NewService(sr, sys) res := NewService(sysres) if e, _ := sysres.Exists(); e != true { return res, sysres, false } r[res.ID()] = res return res, sysres, true }
func (s *Service) Validate(sys *system.System) []TestResult { skip := false sysservice := sys.NewService(s.Service, sys, util.Config{}) var results []TestResult results = append(results, ValidateValue(s, "enabled", s.Enabled, sysservice.Enabled, skip)) results = append(results, ValidateValue(s, "running", s.Running, sysservice.Running, skip)) return results }
func (r ServiceMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Service, system.Service, bool) { sysres := sys.NewService(sr, sys, util.Config{}) // FIXME: Do we want to be silent about errors? res, _ := NewService(sysres, util.Config{}) if e, _ := sysres.Exists(); e != true { return res, sysres, false } r[res.ID()] = res return res, sysres, true }
func (s *Service) Validate(sys *system.System) []TestResult { sysservice := sys.NewService(s.Service, sys) var results []TestResult results = append(results, ValidateValue(s.Service, "enabled", s.Enabled, sysservice.Enabled)) results = append(results, ValidateValue(s.Service, "running", s.Running, sysservice.Running)) return results }
func (r ServiceMap) AppendSysResource(sr string, sys *system.System, config util.Config) (*Service, error) { sysres := sys.NewService(sr, sys, config) res, err := NewService(sysres, config) if err != nil { return nil, err } if old_res, ok := r[res.ID()]; ok { res.Title = old_res.Title res.Meta = old_res.Meta } r[res.ID()] = res return res, nil }
func (r ServiceMap) AppendSysResource(sr string, sys *system.System) (*Service, system.Service) { sysres := sys.NewService(sr, sys) res := NewService(sysres) r[res.ID()] = res return res, sysres }