Documentation ¶
Index ¶
- Constants
- Variables
- func Delete(schemaName string, ids []uint64) (int64, error)
- func GetLastKind(path string) string
- func GetRolePath(path string) string
- func Save(schemaName string, id uint64) (int, error)
- type Node
- type PositionPath
- type Role
- func (this *Role) AddRole(subRoleSpec *spec.RoleSpec, values map[string]interface{}) *Role
- func (this *Role) AddRoles(subRoleSpec *spec.RoleSpec, count int, values []map[string]interface{}) *[]*Role
- func (this *Role) CanbeAdd(specId uint64) int
- func (this *Role) CanbeRemove(specId uint64) int
- func (this *Role) Delete() int64
- func (this *Role) Find(path string) (interface{}, string, bool)
- func (this *Role) Get(id uint64) *Role
- func (this *Role) GetActual(isState bool) map[string]interface{}
- func (this *Role) GetCount(kind string) int
- func (this *Role) GetMultiplicity(specId uint64) (int, int)
- func (this *Role) GetPropertyValue(kind string) (interface{}, error)
- func (this *Role) GetValue(path string) (interface{}, error)
- func (this *Role) Load(kind string) []*Role
- func (this *Role) PutActionResult(actionResult *entity.ActionResult) error
- func (this *Role) PutConnection(conn *entity.Connection) error
- func (this *Role) PutFixedActual(fixedActual interface{}) error
- func (this *Role) PutProperty(property *entity.Property) (err error)
- func (this *Role) PutRole(role *Role) error
- func (this *Role) RemoveRole(role *Role) bool
- func (this *Role) SaveAll() (int, error)
- func (this *Role) SetActual(actual map[string]interface{}, isState bool, isCheckActualId bool) map[uint64]map[string]error
- func (this *Role) SetPropertyValue(kind string, value interface{}) (bool, error)
- func (this *Role) SetValue(path string, value interface{}) (bool, error)
- func (this *Role) UpdateProperty() error
- func (role *Role) Version() *Role
Constants ¶
View Source
const ( Path_Seperator = "." Path_RootChar = "/" Path_FuzzyChar = "*" Path_StartChar = "[" Path_EndChar = "]" )
View Source
const ( StartPosition_Root = "R" StartPosition_Current = "C" StartPosition_Fuzzy = "F" )
*
- @Description: R:从根节点开始;C:从当前节点开始;F:模糊查询
- @author: Jason
- @date: 2017年4月17日 下午8:24:56 *
Variables ¶
View Source
var MemCache = cache.NewMemCache("actual", 60, 10)
Functions ¶
Types ¶
type PositionPath ¶
type PositionPath struct { Current int Starter string //StartPosition.R Nodes []*Node SpecType string }
func NewPositionPath ¶
func NewPositionPath(path string) *PositionPath
type Role ¶
type Role struct { entity.Role `json:",omitempty"` RoleSpec *spec.RoleSpec `json:"-,omitempty"` // 以固定属性存在的直接下属属性,在非关系数据库(bolt)的时候所有的字段可以动态地全部存放,Properties将为空 FixedActual interface{} `json:",omitempty"` // 所有下属属性的前端交互的脏标志 PropertyStates map[string]string `json:"-,omitempty"` // 所有的直接下属角色实例,kind为键值的数组 Roles map[string][]*Role `json:",omitempty"` Connections map[uint64]*entity.Connection `json:",omitempty"` // 所有的直接下属属性元素实例 Properties []*entity.Property `json:",omitempty"` // 所有的直接下属行为结果实例 ActionResults map[string]*entity.ActionResult `json:",omitempty"` /** 删除的role,保存数据库结束后清除 */ DeleteRoles map[uint64]*Role `json:",omitempty"` /** 删除的角色的编号,用于通知前端,返回前端后清除 */ DeleteActuals []uint64 `json:",omitempty"` ParentRole *Role `json:"-,omitempty"` // contains filtered or unexported fields }
func (*Role) CanbeRemove ¶
func (*Role) GetPropertyValue ¶
func (*Role) PutActionResult ¶
func (this *Role) PutActionResult(actionResult *entity.ActionResult) error
func (*Role) PutConnection ¶
func (this *Role) PutConnection(conn *entity.Connection) error
func (*Role) PutFixedActual ¶
func (*Role) PutProperty ¶
* 把属性放入角色中,属性可能只有值,无specId,计算属性也未填充
func (*Role) RemoveRole ¶
func (*Role) SetPropertyValue ¶
*
- @param kind
- @param value
- @return
- @Description: 根据属性kind和位置设置属性值 先设置角色对象的值, 再设置静态属性的值,不成功设置到动态属性的值,
- 设置成功,更新角色脏标志
Source Files ¶
Click to show internal directories.
Click to hide internal directories.