Documentation ¶
Index ¶
- func AddDepends(db *gorm.DB, res []rel.Res, resB rel.Res, relTyp ...rel.Type) error
- func AddRelation(db *gorm.DB, resA rel.Res, resB rel.Res, relTyp ...rel.Type) error
- func AddRelations(db *gorm.DB, resA rel.Res, res []rel.Res, relTyp ...rel.Type) error
- func CheckOp(db *gorm.DB, res rel.Res, op rel.ResOp) error
- func CheckRelation(db *gorm.DB, resA rel.Res, resB rel.Res, relTyp ...rel.Type) error
- func DelRelation(db *gorm.DB, resA rel.Res, resB rel.Res, relTyp ...rel.Type) error
- func DelRes(db *gorm.DB, res rel.Res) error
- func GetDependents(db *gorm.DB, res rel.Res, relTypes ...rel.Type) ([]*rel.Relation, error)
- func GetRelations(db *gorm.DB, res rel.Res, relTypes ...rel.Type) ([]*rel.Relation, error)
- func Init(db *gorm.DB) error
- func NewDependMgr(db *gorm.DB) (*internal.Mgr, error)
- func Register(typ rel.ResType, op rel.ResOp, ignores []rel.ResType) error
- type IDependMgr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDepends ¶
AddDepends 记录关系:资源B 依赖 一组资源 relTyp长度不超过1;relType为空,指定默认依赖方式
func AddRelation ¶
AddRelation 记录关系:资源A 被 资源B 依赖 relTyp长度不超过1;relType为空,指定默认依赖方式
func AddRelations ¶
AddRelations 记录关系:资源A 被 一组资源 依赖 relTyp长度不超过1;relType为空,指定默认依赖方式
func CheckRelation ¶
CheckRelation 检查关系:资源A 是否被 资源B 依赖 relTyp长度不超过1;relType为空,指定默认依赖方式
func DelRelation ¶
DelRelation 删除关系:资源A 被 资源B 依赖 relTyp长度不超过1;relType为空,指定默认依赖方式
func GetDependents ¶
GetDependents 查询关系:查询某个资源【所依赖】的关系 relTypes为空,会检查该资源的所有所依赖关系
func GetRelations ¶
GetRelations 查询关系:查询某个资源【被依赖】的关系 relTypes为空,会检查该资源的所有被依赖关系
Types ¶
type IDependMgr ¶
type IDependMgr interface { Register(typ rel.ResType, op rel.ResOp, ignores []rel.ResType) error AddRelation(db *gorm.DB, idA string, typA rel.ResType, relTyp rel.Type, idB string, typB rel.ResType) error AddRelations(db *gorm.DB, idA string, typA rel.ResType, relTyp rel.Type, res []rel.Res) error AddDepends(db *gorm.DB, res []rel.Res, relTyp rel.Type, idB string, typB rel.ResType) error DelRelation(db *gorm.DB, idA string, typA rel.ResType, relTyp rel.Type, idB string, typB rel.ResType) error CheckRelation(db *gorm.DB, idA string, typA rel.ResType, relTyp rel.Type, idB string, typB rel.ResType) error GetRelations(db *gorm.DB, id string, typ rel.ResType, relTypes []rel.Type) ([]*rel.Relation, error) GetDependents(db *gorm.DB, id string, typ rel.ResType, relTypes []rel.Type) ([]*rel.Relation, error) CheckOp(db *gorm.DB, id string, typ rel.ResType, op rel.ResOp) error DelRes(db *gorm.DB, id string, typ rel.ResType) error }
Click to show internal directories.
Click to hide internal directories.