Compare commits

...

2 Commits

Author SHA1 Message Date
mr
5f735b6e9d No more value in resource 2024-10-01 09:16:56 +02:00
mr
f490dc3555 Container is optionnal 2024-10-01 09:15:26 +02:00
2 changed files with 3 additions and 17 deletions

View File

@ -26,19 +26,6 @@ type AbstractResource struct {
ResourceModel *ResourceModel `json:"resource_model,omitempty" bson:"resource_model,omitempty"` // ResourceModel is the model of the resource
}
/*
* GetModelValue returns the value of the model key
*/
func (abs *AbstractResource) GetModelValue(cat string, key string) interface{} {
if abs.ResourceModel == nil || abs.ResourceModel.Model == nil {
return nil
}
if _, ok := abs.ResourceModel.Model[key]; !ok {
return nil
}
return abs.ResourceModel.Model[cat][key].Value
}
/*
* GetModelType returns the type of the model key
*/
@ -77,9 +64,8 @@ func (abs *AbstractResource) GetModelReadOnly(cat string, key string) interface{
}
type Model struct {
Type string `json:"type,omitempty" bson:"type,omitempty"` // Type is the type of the model
Value interface{} `json:"value,omitempty" bson:"value,omitempty"` // Value is the value of the model
ReadOnly bool `json:"readonly,omitempty" bson:"readonly,omitempty"` // ReadOnly is the readonly of the model
Type string `json:"type,omitempty" bson:"type,omitempty"` // Type is the type of the model
ReadOnly bool `json:"readonly,omitempty" bson:"readonly,omitempty"` // ReadOnly is the readonly of the model
}
/*

View File

@ -35,7 +35,7 @@ type ProcessingResource struct {
Parallel bool `bson:"parallel,omitempty" json:"parallel,omitempty"` // Parallel is a flag that indicates if the processing is parallel
ScalingModel uint `bson:"scaling_model,omitempty" json:"scaling_model,omitempty"` // ScalingModel is the scaling model
DiskIO string `bson:"disk_io,omitempty" json:"disk_io,omitempty"` // DiskIO is the disk IO
Container Container `bson:"container,omitempty" json:"container,omitempty"` // Container is the container
Container *Container `bson:"container,omitempty" json:"container,omitempty"` // Container is the container
Execute []Execute `bson:"execute,omitempty" json:"execute,omitempty"` // Execute is the execution
}