car

package
v0.0.0-...-ad7ca9c Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetadataFileName = "metadata.json"
	EntriesFileName  = "entries.csv"
	EntriesCSVFields = "name,path,size,sha256,mtime"
)
View Source
const (
	GraphsplitManifestFileName = "manifest.csv"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GraphsplitManifest

type GraphsplitManifest struct {
	File    cadre.File
	Entries []GraphsplitManifestEntry
}

func NewGraphsplitManifest

func NewGraphsplitManifest(path string) (GraphsplitManifest, error)

func (GraphsplitManifest) String

func (m GraphsplitManifest) String() string

type GraphsplitManifestEntry

type GraphsplitManifestEntry struct {
	FileName    string `json:"file_name"`
	PayloadCID  string `json:"payload_cid"`
	PayloadHash string `json:"payload_hash"`
	PayloadSize int64  `json:"payload_size"`
	PieceCID    string `json:"piece_cid"`
	PieceHash   string `json:"piece_hash"`
	PieceSize   int64  `json:"piece_size"`
}

func (GraphsplitManifestEntry) String

func (e GraphsplitManifestEntry) String() string

func (GraphsplitManifestEntry) ToMap

func (e GraphsplitManifestEntry) ToMap() (map[string]any, error)

type Manifest

type Manifest struct {
	// contains filtered or unexported fields
}

func NewManifest

func NewManifest(namespace string, index uint) *Manifest

func Read

func Read(src string) (*Manifest, error)

func ReadWithIndex

func ReadWithIndex(src string, index int) (*Manifest, error)

func (*Manifest) Add

func (m *Manifest) Add(entries ...*cadre.File)

func (*Manifest) Count

func (m *Manifest) Count() int

func (*Manifest) EntryNames

func (m *Manifest) EntryNames() []string

func (*Manifest) Graphsplit

func (m *Manifest) Graphsplit() GraphsplitManifest

func (*Manifest) Id

func (m *Manifest) Id() string

func (*Manifest) Index

func (m *Manifest) Index() int

func (*Manifest) Namespace

func (m *Manifest) Namespace() string

func (*Manifest) Path

func (m *Manifest) Path() string

func (*Manifest) ReadAllEntries

func (m *Manifest) ReadAllEntries() ([]*cadre.File, error)

func (*Manifest) ReadEntries

func (m *Manifest) ReadEntries(ctx context.Context) (<-chan *cadre.File, error)

func (*Manifest) Size

func (m *Manifest) Size() int64

func (*Manifest) String

func (m *Manifest) String() string

func (*Manifest) WriteTo

func (m *Manifest) WriteTo(dst string) error

type Metadata

type Metadata struct {
	Entries   int    `json:"entries"`
	Index     int    `json:"page"`
	Namespace string `json:"namespace"`
	Size      int64  `json:"size"`
}

Jump to

Keyboard shortcuts

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