Documentation ¶
Index ¶
- type AbstractResource
- type Model
- type ResourceModel
- func (dma *ResourceModel) Deserialize(j map[string]interface{}) utils.DBObject
- func (r *ResourceModel) GenerateID()
- func (d *ResourceModel) GetAccessor(caller *tools.HTTPCaller) utils.Accessor
- func (ao *ResourceModel) GetID() string
- func (d *ResourceModel) GetName() string
- func (dma *ResourceModel) Serialize() map[string]interface{}
- func (ao *ResourceModel) UpToDate()
- type ResourceModelMongoAccessor
- func (wfa *ResourceModelMongoAccessor) CopyOne(data utils.DBObject) (utils.DBObject, int, error)
- func (wfa *ResourceModelMongoAccessor) DeleteOne(id string) (utils.DBObject, int, error)
- func (wfa ResourceModelMongoAccessor) LoadAll() ([]utils.ShallowDBObject, int, error)
- func (wfa *ResourceModelMongoAccessor) LoadOne(id string) (utils.DBObject, int, error)
- func (wfa *ResourceModelMongoAccessor) Search(filters *dbs.Filters, search string) ([]utils.ShallowDBObject, int, error)
- func (wfa *ResourceModelMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject, int, error)
- func (wfa *ResourceModelMongoAccessor) UpdateOne(set utils.DBObject, id string) (utils.DBObject, int, error)
- type WebResource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbstractResource ¶
type AbstractResource struct { utils.AbstractObject // AbstractObject contains the basic fields of an object (id, name) ShortDescription string `json:"short_description,omitempty" bson:"short_description,omitempty" validate:"required"` // ShortDescription is the short description of the resource Description string `json:"description,omitempty" bson:"description,omitempty"` // Description is the description of the resource Logo string `json:"logo,omitempty" bson:"logo,omitempty" validate:"required"` // Logo is the logo of the resource Owner string `json:"owner,omitempty" bson:"owner,omitempty" validate:"required"` // Owner is the owner of the resource OwnerLogo string `json:"owner_logo,omitempty" bson:"owner_logo,omitempty"` // OwnerLogo is the owner logo of the resource SourceUrl string `json:"source_url,omitempty" bson:"source_url,omitempty" validate:"required"` // SourceUrl is the source URL of the resource PeerID string `json:"peer_id,omitempty" bson:"peer_id,omitempty" validate:"required"` // PeerID is the ID of the peer getting this resource Price string `json:"price,omitempty" bson:"price,omitempty"` // Price is the price of access to the resource License string `json:"license,omitempty" bson:"license,omitempty"` // License is the license of the resource ResourceModel *ResourceModel `json:"resource_model,omitempty" bson:"resource_model,omitempty"` // ResourceModel is the model of the resource }
* AbstractResource is a struct that represents a resource * it defines the resource data
func (*AbstractResource) GetModelKeys ¶
func (abs *AbstractResource) GetModelKeys() []string
* GetModelKeys returns the keys of the model
func (*AbstractResource) GetModelReadOnly ¶
func (abs *AbstractResource) GetModelReadOnly(cat string, key string) interface{}
* GetModelReadOnly returns the readonly of the model key
func (*AbstractResource) GetModelType ¶
func (abs *AbstractResource) GetModelType(cat string, key string) interface{}
* GetModelType returns the type of the model key
type ResourceModel ¶
type ResourceModel struct { UUID string `json:"id,omitempty" bson:"id,omitempty" validate:"required"` ResourceType string `json:"resource_type,omitempty" bson:"resource_type,omitempty" validate:"required"` VarRefs map[string]string `json:"var_refs,omitempty" bson:"var_refs,omitempty"` // VarRefs is the variable references of the model Model map[string]map[string]Model `json:"model,omitempty" bson:"model,omitempty"` }
* ResourceModel is a struct that represents a resource model * it defines the resource metadata and specificity * Warning: This struct is not user available, it is only used by the system
func (*ResourceModel) Deserialize ¶
func (dma *ResourceModel) Deserialize(j map[string]interface{}) utils.DBObject
func (*ResourceModel) GenerateID ¶
func (r *ResourceModel) GenerateID()
func (*ResourceModel) GetAccessor ¶
func (d *ResourceModel) GetAccessor(caller *tools.HTTPCaller) utils.Accessor
func (*ResourceModel) GetID ¶
func (ao *ResourceModel) GetID() string
func (*ResourceModel) GetName ¶
func (d *ResourceModel) GetName() string
func (*ResourceModel) Serialize ¶
func (dma *ResourceModel) Serialize() map[string]interface{}
func (*ResourceModel) UpToDate ¶
func (ao *ResourceModel) UpToDate()
type ResourceModelMongoAccessor ¶
type ResourceModelMongoAccessor struct {
utils.AbstractAccessor // AbstractAccessor contains the basic fields of an accessor (model, caller)
}
func (ResourceModelMongoAccessor) LoadAll ¶
func (wfa ResourceModelMongoAccessor) LoadAll() ([]utils.ShallowDBObject, int, error)
func (*ResourceModelMongoAccessor) Search ¶
func (wfa *ResourceModelMongoAccessor) Search(filters *dbs.Filters, search string) ([]utils.ShallowDBObject, int, error)
type WebResource ¶
Click to show internal directories.
Click to hide internal directories.