metav2

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: MIT Imports: 1 Imported by: 0

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

Jump to

Keyboard shortcuts

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