Documentation ¶
Index ¶
- Constants
- Variables
- func Checksum(data []byte) uint32
- func CreateStoragePath()
- func GetCRCFilePath(fid string) string
- func ParseDataFilename(fileBaseName string) (fid string, blockIndex int)
- func ReadFile(path string) ([]byte, error)
- func VerifyBlockCRC(blockIndex int, block []byte, crcArray []uint32) bool
- type File
- type Item
Constants ¶
View Source
const ( DataFileExtension string = ".data" CRCFileExtension string = ".crc" )
Variables ¶
View Source
var ( ErrorReadCRCFile = errors.New("failed to read crc file") ErrorParseCRC = errors.New("failed to parse crc content") ErrorInvalidCRC = errors.New("invalid crc content") ErrorVerifyCRC = errors.New("error verifying crc of file") )
View Source
var ( ErrorOpenDataFile = errors.New("error opening data file") ErrorReadDataFile = errors.New("error opening data file") )
View Source
var (
Path = "../../data/"
)
Functions ¶
func CreateStoragePath ¶
func CreateStoragePath()
func ParseDataFilename ¶
parseDataFilename 解析数据文件的文件名+扩展名部分,并返回 FID 和 文件的块序号
Types ¶
Click to show internal directories.
Click to hide internal directories.