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) CreateMany(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
- func (mapper *DataMapper) CreateOne(db *gorm.DB, modelObj 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) PatchMany(db *gorm.DB, jsonIDPatches []mdlutil.JSONIDPatch, ep *hook.EndPoint, ...) (*MapperRet, *webrender.RetError)
- func (mapper *DataMapper) PatchOne(db *gorm.DB, jsonPatch []byte, id *datatype.UUID, 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) UpdateMany(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
- func (mapper *DataMapper) UpdateOne(db *gorm.DB, modelObj mdl.IModel, id *datatype.UUID, ep *hook.EndPoint, ...) (*MapperRet, *webrender.RetError)
- type IDataMapper
- type MapperRet
- type OrgPartition
- func (mapper *OrgPartition) CreateMany(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
- func (mapper *OrgPartition) CreateOne(db *gorm.DB, modelObj 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) PatchMany(db *gorm.DB, jsonIDPatches []mdlutil.JSONIDPatch, ep *hook.EndPoint, ...) (*MapperRet, *webrender.RetError)
- func (mapper *OrgPartition) PatchOne(db *gorm.DB, jsonPatch []byte, id *datatype.UUID, 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) UpdateMany(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
- func (mapper *OrgPartition) UpdateOne(db *gorm.DB, modelObj mdl.IModel, id *datatype.UUID, ep *hook.EndPoint, ...) (*MapperRet, *webrender.RetError)
- type UserMapper
- func (mapper *UserMapper) CreateMany(db *gorm.DB, modelObj []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
- func (mapper *UserMapper) CreateOne(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) PatchMany(db *gorm.DB, jsonIDPatches []mdlutil.JSONIDPatch, ep *hook.EndPoint, ...) (*MapperRet, *webrender.RetError)
- func (mapper *UserMapper) PatchOne(db *gorm.DB, jsonPatch []byte, id *datatype.UUID, 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) UpdateMany(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
- func (mapper *UserMapper) UpdateOne(db *gorm.DB, modelObj mdl.IModel, id *datatype.UUID, ep *hook.EndPoint, ...) (*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.IServiceV1
}
DataMapper is a basic CRUD manager
func (*DataMapper) CreateMany ¶ added in v0.9.0
func (mapper *DataMapper) CreateMany(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) CreateOne ¶ added in v0.9.0
func (mapper *DataMapper) CreateOne(db *gorm.DB, modelObj mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
CreateOne 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?
func (*DataMapper) PatchMany ¶ added in v0.9.0
func (mapper *DataMapper) PatchMany(db *gorm.DB, jsonIDPatches []mdlutil.JSONIDPatch, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
PatchMany patches multiple mdl
func (*DataMapper) PatchOne ¶ added in v0.9.0
func (mapper *DataMapper) PatchOne(db *gorm.DB, jsonPatch []byte, id *datatype.UUID, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
PatchOne updates model based on this json
func (*DataMapper) ReadOne ¶ added in v0.9.0
func (mapper *DataMapper) 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
type IDataMapper ¶ added in v0.3.3
type IDataMapper interface { CreateMany(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError) CreateOne(db *gorm.DB, modelObj mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError) 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) UpdateMany(db *gorm.DB, modelObjs []mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError) UpdateOne(db *gorm.DB, modelObj mdl.IModel, id *datatype.UUID, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError) PatchMany(db *gorm.DB, jsonIDPatches []mdlutil.JSONIDPatch, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError) PatchOne(db *gorm.DB, jsonPatch []byte, id *datatype.UUID, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *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) }
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 MapperRet ¶ added in v0.9.0
type MapperRet struct { Ms []mdl.IModel // if for cardinality 1, only contains one element Fetcher *hfetcher.HandlerFetcher }
type OrgPartition ¶ added in v0.9.7
type OrgPartition struct {
Service service.IServiceV2
}
func (*OrgPartition) CreateMany ¶ added in v0.9.7
func (mapper *OrgPartition) CreateMany(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) CreateOne ¶ added in v0.9.7
func (mapper *OrgPartition) CreateOne(db *gorm.DB, modelObj mdl.IModel, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
CreateOne 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) PatchMany ¶ added in v0.9.7
func (mapper *OrgPartition) PatchMany(db *gorm.DB, jsonIDPatches []mdlutil.JSONIDPatch, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
PatchMany patches multiple mdl
func (*OrgPartition) PatchOne ¶ added in v0.9.7
func (mapper *OrgPartition) PatchOne(db *gorm.DB, jsonPatch []byte, id *datatype.UUID, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
PatchOne updates model based on this json
func (*OrgPartition) ReadOne ¶ added in v0.9.7
func (mapper *OrgPartition) 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
type UserMapper ¶
type UserMapper struct {
Service service.IServiceV1
}
UserMapper is a User CRUD manager
func SharedUserMapper ¶
func SharedUserMapper() *UserMapper
SharedUserMapper creats a singleton of Crud object
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) CreateOne ¶
func (mapper *UserMapper) CreateOne(db *gorm.DB, modelObj 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) 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) 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) PatchOne ¶ added in v0.5.0
func (mapper *UserMapper) PatchOne(db *gorm.DB, jsonPatch []byte, id *datatype.UUID, ep *hook.EndPoint, cargo *hook.Cargo) (*MapperRet, *webrender.RetError)
PatchOne updates model based on this json
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