func (r ResourceTypeMap) AppendSysResourceIfExists(sr string, sys *system.System) (*ResourceType, system.ResourceType, bool) { sysres := sys.NewResourceType(sr, sys) res := NewResourceType(sysres, []string{}) if e, _ := sysres.Exists(); e != true { return res, sysres, false } r[res.ID()] = res return res, sysres, true }
func (r ResourceTypeMap) AppendSysResource(sr string, sys *system.System, config util.Config) (*ResourceType, error) { sysres := sys.NewResourceType(sr, sys, config) res, err := NewResourceType(sysres, config) if err != nil { return nil, err } r[res.ID()] = res return res, nil }
func (r ResourceTypeMap) AppendSysResourceIfExists(sr string, sys *system.System) (*ResourceType, system.ResourceType, bool) { sysres := sys.NewResourceType(sr, sys, util.Config{}) // FIXME: Do we want to be silent about errors? res, _ := NewResourceType(sysres, util.Config{}) if e, _ := sysres.Exists(); e != true { return res, sysres, false } r[res.ID()] = res return res, sysres, true }
func (r ResourceTypeMap) AppendSysResource(sr string, sys *system.System, config util.Config) (*ResourceType, error) { sysres := sys.NewResourceType(sr, sys, config) res, err := NewResourceType(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 ResourceTypeMap) AppendSysResource(sr string, sys *system.System, ignoreList []string) (*ResourceType, system.ResourceType) { sysres := sys.NewResourceType(sr, sys) res := NewResourceType(sysres, ignoreList) r[res.ID()] = res return res, sysres }