Documentation
¶
Overview ¶
Package metav2 implements the functions, types, and interfaces for the module.
Index ¶
Constants ¶
View Source
const EmbeddedFileSizeThreshold = 256 * 1024
EmbeddedFileSizeThreshold Defines the maximum size of metadata for small files to be embedded directly (256KB)
View Source
const Version = 2
Version defines the version of the metadata format.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileMetaV2 ¶
type FileMetaV2 struct {
FileSize int64 `msgpack:"s"` // File size
ModifyTime int64 `msgpack:"t"` // Modify time
MimeType string `msgpack:"m"` // File mime type
RefCount int32 `msgpack:"r"` // Reference count
BlobSize int32 `msgpack:"bs"` // Blob size
BlobHashes []string `msgpack:"bh"` // Reference to the blob content
EmbeddedData []byte `msgpack:"ed,omitempty"` // Used to store file content that is less than the EmbeddedFileSizeThreshold
}
FileMetaV2 represents the metadata of a file.
func (FileMetaV2) CurrentVersion ¶
func (f FileMetaV2) CurrentVersion() int32
func (FileMetaV2) GetEmbeddedData ¶
func (f FileMetaV2) GetEmbeddedData() []byte
GetEmbeddedData returns the embedded data of the file.
func (FileMetaV2) GetShards ¶
func (f FileMetaV2) GetShards() []string
GetShards returns the blob hashes (shards) of the file.
func (FileMetaV2) ModTime ¶
func (f FileMetaV2) ModTime() time.Time
func (FileMetaV2) Size ¶
func (f FileMetaV2) Size() int64
Click to show internal directories.
Click to hide internal directories.