Documentation ¶
Overview ¶
drule2的新一代硬盘永久存储
支持分区操作,类似于SQL数据库的“库”概念。
Index ¶
- Constants
- func CheckAreaName(name string) (allow bool)
- type HardStorage
- func (h *HardStorage) AreaDelete(area string) (err error)
- func (h *HardStorage) AreaExist(area string) (have bool)
- func (h *HardStorage) AreaInit(path string) (err error)
- func (h *HardStorage) AreaList() (list []string, err error)
- func (h *HardStorage) AreaReName(oldname, newname string) (err error)
- func (h *HardStorage) RoleAdd(area string, role roles.Roleer) (err error)
- func (h *HardStorage) RoleAddMiddleData(area string, mid roles.RoleMiddleData) (err error)
- func (h *HardStorage) RoleDelete(area, roleid string) (err error)
- func (h *HardStorage) RoleExist(area, roleid string) (have bool)
- func (h *HardStorage) RoleReadMiddleData(area, roleid string) (rolemid *roles.RoleMiddleData, exist bool, err error)
- func (h *HardStorage) RoleStoreMiddleData(area string, mid *roles.RoleMiddleData) (err error)
- func (h *HardStorage) RoleUpdate(area string, role roles.Roleer) (err error)
- func (h *HardStorage) RoleUpdateMiddleData(area string, mid roles.RoleMiddleData) (err error)
Constants ¶
View Source
const ( HARDSTORAGE_FILE_NAME_DATA = "_data" HARDSTORAGE_FILE_NAME_RELATION = "_relation" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HardStorage ¶
type HardStorage struct {
// contains filtered or unexported fields
}
存储器类型
func NewHardStorage ¶
func NewHardStorage(path string, deep uint8) (hardstorage *HardStorage, err error)
新建一个存储实例,只需要一个存储路径和一个路径深度
func (*HardStorage) AreaReName ¶
func (h *HardStorage) AreaReName(oldname, newname string) (err error)
区域改名
func (*HardStorage) RoleAdd ¶
func (h *HardStorage) RoleAdd(area string, role roles.Roleer) (err error)
增加一个角色
func (*HardStorage) RoleAddMiddleData ¶
func (h *HardStorage) RoleAddMiddleData(area string, mid roles.RoleMiddleData) (err error)
增加一个角色角色的中间格式
func (*HardStorage) RoleDelete ¶
func (h *HardStorage) RoleDelete(area, roleid string) (err error)
删除角色
func (*HardStorage) RoleExist ¶
func (h *HardStorage) RoleExist(area, roleid string) (have bool)
角色是否存在
func (*HardStorage) RoleReadMiddleData ¶
func (h *HardStorage) RoleReadMiddleData(area, roleid string) (rolemid *roles.RoleMiddleData, exist bool, err error)
读取角色的中间数据格式
func (*HardStorage) RoleStoreMiddleData ¶
func (h *HardStorage) RoleStoreMiddleData(area string, mid *roles.RoleMiddleData) (err error)
存储一个角色角色的中间格式(不检查是否存在)
func (*HardStorage) RoleUpdate ¶
func (h *HardStorage) RoleUpdate(area string, role roles.Roleer) (err error)
func (*HardStorage) RoleUpdateMiddleData ¶
func (h *HardStorage) RoleUpdateMiddleData(area string, mid roles.RoleMiddleData) (err error)
更新角色的中间格式(不存在则错误)
Click to show internal directories.
Click to hide internal directories.