some
This commit is contained in:
@@ -40,7 +40,5 @@ type ProcessingResource struct {
|
||||
}
|
||||
|
||||
func (d *ProcessingResource) GetAccessor(peerID string, groups []string, caller *tools.HTTPCaller) utils.Accessor {
|
||||
data := New() // Create a new instance of the accessor
|
||||
data.Init(tools.PROCESSING_RESOURCE, peerID, groups, caller) // Initialize the accessor with the PROCESSING_RESOURCE model type
|
||||
return data
|
||||
return New(tools.PROCESSING_RESOURCE, peerID, groups, caller) // Create a new instance of the accessor
|
||||
}
|
||||
|
@@ -5,19 +5,26 @@ import (
|
||||
|
||||
"cloud.o-forge.io/core/oc-lib/dbs"
|
||||
"cloud.o-forge.io/core/oc-lib/dbs/mongo"
|
||||
"cloud.o-forge.io/core/oc-lib/logs"
|
||||
"cloud.o-forge.io/core/oc-lib/models/resources/resource_model"
|
||||
"cloud.o-forge.io/core/oc-lib/models/utils"
|
||||
"cloud.o-forge.io/core/oc-lib/tools"
|
||||
)
|
||||
|
||||
type processingMongoAccessor struct {
|
||||
utils.AbstractAccessor // AbstractAccessor contains the basic fields of an accessor (model, caller)
|
||||
}
|
||||
|
||||
// New creates a new instance of the processingMongoAccessor
|
||||
func New() *processingMongoAccessor {
|
||||
// New creates a new instance of the storageMongoAccessor
|
||||
func New(t tools.DataType, peerID string, groups []string, caller *tools.HTTPCaller) *processingMongoAccessor {
|
||||
return &processingMongoAccessor{
|
||||
utils.AbstractAccessor{
|
||||
ResourceModelAccessor: resource_model.New(),
|
||||
Logger: logs.CreateLogger(t.String()), // Create a logger with the data type
|
||||
Caller: caller,
|
||||
PeerID: peerID,
|
||||
Groups: groups, // Set the caller
|
||||
Type: t.String(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user