catalog

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

* @Author: nijineko * @Date: 2024-04-12 17:05:21 * @LastEditTime: 2024-04-12 17:35:53 * @LastEditors: nijineko * @Description: catalog管理 * @FilePath: \Miyako\pkg\catalog\catalog.go

* @Author: nijineko * @Date: 2024-04-12 17:11:21 * @LastEditTime: 2024-04-12 17:41:46 * @LastEditors: nijineko * @Description: 生成catalog * @FilePath: \Miyako\pkg\catalog\generate.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

type Catalog struct {
	BlockFile string        `json:"block_file"` // 文件块地址
	Files     []CatalogFile `json:"files"`      // 文件列表
}

func Generate

func Generate(FolderPath string) (*Catalog, error)

*

  • @description: 生成catalog
  • @param {string} FolderPath 文件夹路径
  • @return {*Catalog} catalog
  • @return {error} 错误

func Unmarshal

func Unmarshal(Data []byte) (*Catalog, error)

反序列化Catalog

func (*Catalog) Marshal

func (c *Catalog) Marshal() ([]byte, error)

序列化Catalog

type CatalogFile

type CatalogFile struct {
	Path string `json:"path"` // 路径
	Size int64  `json:"size"` // 大小 (bytes)
	CRC  uint32 `json:"crc"`  // CRC32
}

Jump to

Keyboard shortcuts

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