resources: Remove "NewRes" constructors
Remove the New constructors since calling Init should be done by the engine, and not by the user even when using mgmt as a lib. This is also the case in tests! It used to be the case that a user might want to call Init manually, but that is no longer the case!
This commit is contained in:
@@ -79,22 +79,6 @@ type VirtRes struct {
|
||||
uriScheme virtURISchemeType
|
||||
}
|
||||
|
||||
// NewVirtRes is a constructor for this resource. It also calls Init() for you.
|
||||
func NewVirtRes(name string, uri, state string, transient bool, cpus uint, memory uint64, osinit string) (*VirtRes, error) {
|
||||
obj := &VirtRes{
|
||||
BaseRes: BaseRes{
|
||||
Name: name,
|
||||
},
|
||||
URI: uri,
|
||||
State: state,
|
||||
Transient: transient,
|
||||
CPUs: cpus,
|
||||
Memory: memory,
|
||||
OSInit: osinit,
|
||||
}
|
||||
return obj, obj.Init()
|
||||
}
|
||||
|
||||
// Default returns some sensible defaults for this resource.
|
||||
func (obj *VirtRes) Default() Res {
|
||||
return &VirtRes{}
|
||||
|
||||
Reference in New Issue
Block a user