internal

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mgr

type Mgr struct {
	// contains filtered or unexported fields
}

func NewMgr

func NewMgr() *Mgr

func (*Mgr) AddDepends

func (mgr *Mgr) AddDepends(db *gorm.DB, res []rel.Res, relTyp rel.Type, idB string, typB rel.ResType) error

func (*Mgr) AddRelation

func (mgr *Mgr) AddRelation(db *gorm.DB, idA string, typA rel.ResType, relTyp rel.Type, idB string, typB rel.ResType) error

func (*Mgr) AddRelations

func (mgr *Mgr) AddRelations(db *gorm.DB, idA string, typA rel.ResType, relTyp rel.Type, res []rel.Res) error

func (*Mgr) CheckOp

func (mgr *Mgr) CheckOp(db *gorm.DB, id string, typ rel.ResType, op rel.ResOp) error

CheckOp 检查是否可以对某个资源执行op操作

func (*Mgr) CheckRelation

func (mgr *Mgr) CheckRelation(db *gorm.DB, idA string, typA rel.ResType, relTyp rel.Type, idB string, typB rel.ResType) error

func (*Mgr) DelRelation

func (mgr *Mgr) DelRelation(db *gorm.DB, idA string, typA rel.ResType, relTyp rel.Type, idB string, typB rel.ResType) error

func (*Mgr) DelRes

func (mgr *Mgr) DelRes(db *gorm.DB, id string, typ rel.ResType) error

DelRes 删除某个资源的所有关系记录;会检查该资源的所有依赖关系

func (*Mgr) GetDependents

func (mgr *Mgr) GetDependents(db *gorm.DB, id string, typ rel.ResType, relTypes []rel.Type) ([]*rel.Relation, error)

GetDependents 查询某个资源【所依赖】的关系:relTypes为空,会检查该资源的所有所依赖关系

func (*Mgr) GetRelations

func (mgr *Mgr) GetRelations(db *gorm.DB, id string, typ rel.ResType, relTypes []rel.Type) ([]*rel.Relation, error)

GetRelations 查询某个资源【被依赖】的关系;relTypes为空,会检查该资源的所有被依赖关系

func (*Mgr) Register

func (mgr *Mgr) Register(typ rel.ResType, op rel.ResOp, ignores []rel.ResType) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL