mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-17 02:47:51 +01:00
Add TypeEbook. Clarify documentation on File Type and File Format.
This commit is contained in:
@@ -9,8 +9,8 @@ File records:
|
|||||||
Offset Size Info
|
Offset Size Info
|
||||||
0 32 Hash blake3 of the file content
|
0 32 Hash blake3 of the file content
|
||||||
32 16 File ID
|
32 16 File ID
|
||||||
48 1 File Type (low-level)
|
48 1 File Type
|
||||||
49 2 File Format (high-level)
|
49 2 File Format
|
||||||
51 8 File Size
|
51 8 File Size
|
||||||
59 2 Count of Tags
|
59 2 Count of Tags
|
||||||
61 ? Tags
|
61 ? Tags
|
||||||
@@ -54,8 +54,8 @@ const (
|
|||||||
type BlockRecordFile struct {
|
type BlockRecordFile struct {
|
||||||
Hash []byte // Hash of the file data
|
Hash []byte // Hash of the file data
|
||||||
ID uuid.UUID // ID
|
ID uuid.UUID // ID
|
||||||
Type uint8 // Type (low-level)
|
Type uint8 // File Type
|
||||||
Format uint16 // Format (high-level)
|
Format uint16 // File Format
|
||||||
Size uint64 // Size of the file data
|
Size uint64 // Size of the file data
|
||||||
TagsRaw []BlockRecordFileTag // Tags to provide additional metadata
|
TagsRaw []BlockRecordFileTag // Tags to provide additional metadata
|
||||||
TagsDecoded []interface{} // Decoded tags. See FileTagX structures.
|
TagsDecoded []interface{} // Decoded tags. See FileTagX structures.
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ Definition of all recognized file formats. This file is likely being updated mor
|
|||||||
|
|
||||||
package core
|
package core
|
||||||
|
|
||||||
// Low-level content types of file data. This is a copy from Intelligence X.
|
// General content types of data.
|
||||||
const (
|
const (
|
||||||
TypeBinary = iota // Binary/unspecified
|
TypeBinary = iota // Binary/unspecified
|
||||||
TypeText // Plain text
|
TypeText // Plain text
|
||||||
@@ -20,9 +20,10 @@ const (
|
|||||||
TypeContainer // Container files like ZIP, RAR, TAR
|
TypeContainer // Container files like ZIP, RAR, TAR
|
||||||
TypeCompressed // Compressed files like GZ, BZ
|
TypeCompressed // Compressed files like GZ, BZ
|
||||||
TypeFolder // Virtual folder
|
TypeFolder // Virtual folder
|
||||||
|
TypeEbook // Ebook
|
||||||
)
|
)
|
||||||
|
|
||||||
// High-level file types. New ones may be added as required.
|
// File formats. New ones may be added to the list as required.
|
||||||
const (
|
const (
|
||||||
FormatBinary = iota // Binary/unspecified
|
FormatBinary = iota // Binary/unspecified
|
||||||
FormatPDF // PDF document
|
FormatPDF // PDF document
|
||||||
|
|||||||
@@ -123,8 +123,8 @@ type apiFileTagRaw struct {
|
|||||||
type apiBlockRecordFile struct {
|
type apiBlockRecordFile struct {
|
||||||
ID uuid.UUID `json:"id"` // Unique ID.
|
ID uuid.UUID `json:"id"` // Unique ID.
|
||||||
Hash []byte `json:"hash"` // Blake3 hash of the file data
|
Hash []byte `json:"hash"` // Blake3 hash of the file data
|
||||||
Type uint8 `json:"type"` // Type (low-level)
|
Type uint8 `json:"type"` // File Type. For example audio or document. See TypeX.
|
||||||
Format uint16 `json:"format"` // Format (high-level)
|
Format uint16 `json:"format"` // File Format. This is more granular, for example PDF or Word file. See FormatX.
|
||||||
Size uint64 `json:"size"` // Size of the file
|
Size uint64 `json:"size"` // Size of the file
|
||||||
Folder string `json:"folder"` // Folder, optional
|
Folder string `json:"folder"` // Folder, optional
|
||||||
Name string `json:"name"` // Name of the file
|
Name string `json:"name"` // Name of the file
|
||||||
|
|||||||
@@ -175,8 +175,8 @@ type apiBlockRecordProfileBlob struct {
|
|||||||
type apiBlockRecordFile struct {
|
type apiBlockRecordFile struct {
|
||||||
ID uuid.UUID `json:"id"` // Unique ID.
|
ID uuid.UUID `json:"id"` // Unique ID.
|
||||||
Hash []byte `json:"hash"` // Blake3 hash of the file data
|
Hash []byte `json:"hash"` // Blake3 hash of the file data
|
||||||
Type uint8 `json:"type"` // Type (low-level)
|
Type uint8 `json:"type"` // File Type. For example audio or document. See TypeX.
|
||||||
Format uint16 `json:"format"` // Format (high-level)
|
Format uint16 `json:"format"` // File Format. This is more granular, for example PDF or Word file. See FormatX.
|
||||||
Size uint64 `json:"size"` // Size of the file
|
Size uint64 `json:"size"` // Size of the file
|
||||||
Folder string `json:"folder"` // Folder, optional
|
Folder string `json:"folder"` // Folder, optional
|
||||||
Name string `json:"name"` // Name of the file
|
Name string `json:"name"` // Name of the file
|
||||||
|
|||||||
Reference in New Issue
Block a user