Documentation ¶
Index ¶
- func SetLinkTableMapper(mapper IDataMapper)
- func SetMockOwnershipMapper(mapper IDataMapper)
- func SetOrgPartition(mapper IDataMapper)
- func SetOrganizationMapper(mapper IDataMapper)
- func SetSharedGlobalMapper(mapper IDataMapper)
- type DataMapper
- func (mapper *DataMapper) Create(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
- func (mapper *DataMapper) DeleteMany(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
- func (mapper *DataMapper) DeleteOne(db *gorm.DB, id *datatype.UUID, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
- func (mapper *DataMapper) Patch(db *gorm.DB, jsonIDPatches []mdlutil.JSONIDPatch, ep *hook.EndPoint, ...) (*MapperRet, *webrender.RetError)
- func (mapper *DataMapper) ReadMany(db *gorm.DB, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, []userrole.UserRole, *int, *webrender.RetError)
- func (mapper *DataMapper) ReadOne(db *gorm.DB, id *datatype.UUID, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, userrole.UserRole, *webrender.RetError)
- func (mapper *DataMapper) Update(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
- type IDataMapper
- type MapperRet
- type OrgPartition
- func (mapper *OrgPartition) Create(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
- func (mapper *OrgPartition) DeleteMany(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
- func (mapper *OrgPartition) DeleteOne(db *gorm.DB, id *datatype.UUID, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
- func (mapper *OrgPartition) Patch(db *gorm.DB, jsonIDPatches []mdlutil.JSONIDPatch, ep *hook.EndPoint, ...) (*MapperRet, *webrender.RetError)
- func (mapper *OrgPartition) ReadMany(db *gorm.DB, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, []userrole.UserRole, *int, *webrender.RetError)
- func (mapper *OrgPartition) ReadOne(db *gorm.DB, id *datatype.UUID, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, userrole.UserRole, *webrender.RetError)
- func (mapper *OrgPartition) Update(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
- type UserMapper
- func (mapper *UserMapper) Create(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
- func (mapper *UserMapper) CreateMany(db *gorm.DB, modelObj []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
- func (mapper *UserMapper) DeleteMany(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
- func (mapper *UserMapper) DeleteOne(db *gorm.DB, id *datatype.UUID, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
- func (mapper *UserMapper) Patch(db *gorm.DB, jsonIDPatches []mdlutil.JSONIDPatch, ep *hook.EndPoint, ...) (*MapperRet, *webrender.RetError)
- func (mapper *UserMapper) PatchMany(db *gorm.DB, jsonIDPatches []mdlutil.JSONIDPatch, ep *hook.EndPoint, ...) (*MapperRet, *webrender.RetError)
- func (mapper *UserMapper) ReadMany(db *gorm.DB, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, []userrole.UserRole, *int, *webrender.RetError)
- func (mapper *UserMapper) ReadOne(db *gorm.DB, id *datatype.UUID, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, userrole.UserRole, *webrender.RetError)
- func (mapper *UserMapper) Update(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
- func (mapper *UserMapper) UpdateMany(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetLinkTableMapper ¶ added in v0.4.48
func SetLinkTableMapper(mapper IDataMapper)
SetLinkTableMapper allows one to mock LinkTableMapper for testing
func SetMockOwnershipMapper ¶ added in v0.4.48
func SetMockOwnershipMapper(mapper IDataMapper)
SetMockOwnershipMapper allows one to mock OrganizationMapper for testing
func SetOrgPartition ¶ added in v0.9.7
func SetOrgPartition(mapper IDataMapper)
SetOrganizationMapper allows one to mock OrganizationMapper for testing
func SetOrganizationMapper ¶ added in v0.4.48
func SetOrganizationMapper(mapper IDataMapper)
SetOrganizationMapper allows one to mock OrganizationMapper for testing
func SetSharedGlobalMapper ¶ added in v0.4.48
func SetSharedGlobalMapper(mapper IDataMapper)
SetSharedGlobalMapper allows one to mock SharedGlobalMapper for testing
Types ¶
type DataMapper ¶ added in v0.9.0
type DataMapper struct { Service service.IService MapperType mappertype.MapperType }
DataMapper is a basic CRUD manager
func (*DataMapper) Create ¶ added in v0.10.7
func (mapper *DataMapper) Create(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
CreateMany creates an instance of this model based on json and store it in db
func (*DataMapper) DeleteMany ¶ added in v0.9.0
func (mapper *DataMapper) DeleteMany(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
DeleteMany deletes multiple mdl
func (*DataMapper) DeleteOne ¶ added in v0.9.0
func (mapper *DataMapper) DeleteOne(db *gorm.DB, id *datatype.UUID, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
DeleteOne delete the model TODO: delete the groups associated with this record?
type IDataMapper ¶ added in v0.3.3
type IDataMapper interface { ReadMany(db *gorm.DB, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, []userrole.UserRole, *int, *webrender.RetError) ReadOne(db *gorm.DB, id *datatype.UUID, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, userrole.UserRole, *webrender.RetError) DeleteMany(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError) DeleteOne(db *gorm.DB, id *datatype.UUID, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError) // The new one, since endpoints other than read and delete are not necessary to differentiate between two endpoints Create(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError) Update(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError) Patch(db *gorm.DB, jsonIDPatches []mdlutil.JSONIDPatch, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError) }
IDataMapper has all the crud interfaces
func SharedGlobalMapper ¶ added in v0.1.46
func SharedGlobalMapper() IDataMapper
SharedGlobalMapper creats a singleton of Crud object
func SharedLinkTableMapper ¶ added in v0.3.0
func SharedLinkTableMapper() IDataMapper
SharedLinkTableMapper creats a singleton of Crud object
func SharedOrgPartition ¶ added in v0.9.7
func SharedOrgPartition() IDataMapper
SharedOrgPartition creats a singleton of Crud object
func SharedOrganizationMapper ¶ added in v0.1.28
func SharedOrganizationMapper() IDataMapper
SharedOrganizationMapper creats a singleton of Crud object
func SharedOwnershipMapper ¶ added in v0.1.18
func SharedOwnershipMapper() IDataMapper
SharedOwnershipMapper creats a singleton of Crud object
type OrgPartition ¶ added in v0.9.7
type OrgPartition struct { Service service.IService MapperType mappertype.MapperType }
func (*OrgPartition) Create ¶ added in v0.10.7
func (mapper *OrgPartition) Create(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
CreateMany creates an instance of this model based on json and store it in db
func (*OrgPartition) DeleteMany ¶ added in v0.9.7
func (mapper *OrgPartition) DeleteMany(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
DeleteMany deletes multiple mdl
func (*OrgPartition) DeleteOne ¶ added in v0.9.7
func (mapper *OrgPartition) DeleteOne(db *gorm.DB, id *datatype.UUID, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
DeleteOne delete the model TODO: delete the groups associated with this record?
func (*OrgPartition) Patch ¶ added in v0.10.7
func (mapper *OrgPartition) Patch(db *gorm.DB, jsonIDPatches []mdlutil.JSONIDPatch, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
PatchMany patches multiple mdl
type UserMapper ¶
type UserMapper struct { Service service.IService MapperType mappertype.MapperType }
UserMapper is a User CRUD manager
func SharedUserMapper ¶
func SharedUserMapper() *UserMapper
SharedUserMapper creats a singleton of Crud object
func (*UserMapper) Create ¶ added in v0.10.7
func (mapper *UserMapper) Create(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
CreateOne creates an user model based on json and store it in db Also creates a ownership with admin access
func (*UserMapper) CreateMany ¶ added in v0.1.24
func (mapper *UserMapper) CreateMany(db *gorm.DB, modelObj []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
CreateMany :-
func (*UserMapper) DeleteMany ¶ added in v0.3.3
func (mapper *UserMapper) DeleteMany(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
DeleteMany :-
func (*UserMapper) DeleteOne ¶ added in v0.5.0
func (mapper *UserMapper) DeleteOne(db *gorm.DB, id *datatype.UUID, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
DeleteOne deletes the user with the ID
func (*UserMapper) Patch ¶ added in v0.10.7
func (mapper *UserMapper) Patch(db *gorm.DB, jsonIDPatches []mdlutil.JSONIDPatch, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
PatchOne updates model based on this json
func (*UserMapper) PatchMany ¶ added in v0.3.3
func (mapper *UserMapper) PatchMany(db *gorm.DB, jsonIDPatches []mdlutil.JSONIDPatch, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
PatchMany :-
func (*UserMapper) ReadMany ¶ added in v0.5.0
func (mapper *UserMapper) ReadMany(db *gorm.DB, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, []userrole.UserRole, *int, *webrender.RetError)
ReadMany :-
func (*UserMapper) ReadOne ¶ added in v0.5.0
func (mapper *UserMapper) ReadOne(db *gorm.DB, id *datatype.UUID, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, userrole.UserRole, *webrender.RetError)
ReadOne get one model object based on its type and its id string