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

spots' permanent storage

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

func (h *HardStorage) SpotDelete(area, spotid string) (err error)

func (*HardStorage) SpotExist

func (h *HardStorage) SpotExist(area, spotid string) (have bool)

角色是否存在

func (*HardStorage) SpotRead

func (h *HardStorage) SpotRead(area, spotid string) (spot *spots.Spots, err error)

func (*HardStorage) SpotReadWithBody

func (h *HardStorage) SpotReadWithBody(area, spotid string, body spots.DataBodyer) (spot *spots.Spots, err error)

func (*HardStorage) SpotStore

func (h *HardStorage) SpotStore(area string, spot *spots.Spots) (err error)

Jump to

Keyboard shortcuts

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