This commit is contained in:
mr
2024-07-19 13:27:34 +02:00
parent cdc077c59e
commit 3f9814e649
9 changed files with 22 additions and 0 deletions

View File

@@ -14,6 +14,8 @@ type DataResource struct {
Example string `json:"example" bson:"example" required:"true" validate:"required" description:"base64 encoded data"`
}
func (d *DataResource) BindID(id string) {}
func (dma *DataResource) Deserialize(j map[string]interface{}) utils.DBObject {
b, err := json.Marshal(j)
if err != nil {

View File

@@ -37,6 +37,8 @@ type DatacenterGpuModel struct {
TensorCores uint `bson:"tensor_cores,omitempty" json:"tensor_cores,omitempty"`
}
func (d *DatacenterResource) BindID(id string) {}
func (dma *DatacenterResource) Deserialize(j map[string]interface{}) utils.DBObject {
b, err := json.Marshal(j)
if err != nil {

View File

@@ -31,6 +31,8 @@ type ExecutionRequirementsModel struct {
DiskIO string `bson:"disk_io,omitempty" json:"disk_io,omitempty"`
}
func (d *ProcessingResource) BindID(id string) {}
func (dma *ProcessingResource) Deserialize(j map[string]interface{}) utils.DBObject {
b, err := json.Marshal(j)
if err != nil {

View File

@@ -24,6 +24,8 @@ type StorageResource struct {
BookingPrice uint `bson:"booking_price,omitempty" json:"booking_price,omitempty"`
}
func (d *StorageResource) BindID(id string) {}
func (dma *StorageResource) Deserialize(j map[string]interface{}) utils.DBObject {
b, err := json.Marshal(j)
if err != nil {

View File

@@ -57,6 +57,8 @@ type WorkflowResource struct {
WorkflowID string `bson:"workflow_id,omitempty" json:"workflow_id,omitempty"`
}
func (d *WorkflowResource) BindID(id string) { d.WorkflowID = id }
func (d *WorkflowResource) GetAccessor() utils.Accessor {
data := &WorkflowResourceMongoAccessor{}
data.SetLogger(utils.WORKFLOW_RESOURCE)