oc-lib/models/resources/workflow/workflow.go

21 lines
826 B
Go
Raw Normal View History

2024-07-18 11:51:12 +02:00
package oclib
import (
2024-11-28 11:05:54 +01:00
"cloud.o-forge.io/core/oc-lib/models/resources/resource_model"
2024-07-18 13:35:14 +02:00
"cloud.o-forge.io/core/oc-lib/models/utils"
"cloud.o-forge.io/core/oc-lib/tools"
2024-07-18 11:51:12 +02:00
)
// WorkflowResource is a struct that represents a workflow resource
// it defines the resource workflow
2024-07-19 10:54:58 +02:00
type WorkflowResource struct {
2024-07-30 12:08:13 +02:00
resource_model.AbstractResource
WorkflowID string `bson:"workflow_id,omitempty" json:"workflow_id,omitempty"` // WorkflowID is the ID of the native workflow
2024-07-18 11:51:12 +02:00
}
2024-11-28 11:05:54 +01:00
func (d *WorkflowResource) GetAccessor(peerID string, groups []string, caller *tools.HTTPCaller) utils.Accessor {
data := New() // Create a new instance of the accessor
data.Init(tools.WORKFLOW_RESOURCE, peerID, groups, caller) // Initialize the accessor with the WORKFLOW_RESOURCE model type
2024-07-18 11:51:12 +02:00
return data
}