hardstorage

package
v0.0.0-...-2e4edee Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

drule2的新一代硬盘永久存储

支持分区操作,类似于SQL数据库的“库”概念。

Index

Constants

View Source
const (
	HARDSTORAGE_FILE_NAME_DATA     = "_data"
	HARDSTORAGE_FILE_NAME_RELATION = "_relation"
)

Variables

This section is empty.

Functions

func CheckAreaName

func CheckAreaName(name string) (allow bool)

检查区域的名称是否合法,只接受英文数字等,长度则在40个字符以内

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) AreaDelete

func (h *HardStorage) AreaDelete(area string) (err error)

删除区域

func (*HardStorage) AreaExist

func (h *HardStorage) AreaExist(area string) (have bool)

区域是否存在

func (*HardStorage) AreaInit

func (h *HardStorage) AreaInit(path string) (err error)

初始化区域

func (*HardStorage) AreaList

func (h *HardStorage) AreaList() (list []string, 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)

更新角色的中间格式(不存在则错误)

Jump to

Keyboard shortcuts

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