ipfs / ipfs/go-ipld-format

Move Size() elsewhere

Open
#12 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
65
Forks
27
PR merge metrics
No merged PRs in 30d

Description

By case:

1. In CBOR encoded IPLD nodes, it means "size of this encoded node" (property of Block).
2. In protobuf IPFS nodes, it means "size of this encoded node + size of all encoded children" (property of IPFSNode because only IPFSNode links store enough metadata to efficiently compute this).

Therefore, it doesn't belong on `Node`.

1. Define `Size` on `Block` that returns the size of the encoded block case 1. Note: This `size` method *should not* be able to return an error.
2. Define some form of `FileSize`/`IPFSDagSize` on an `IPFSNode` type (elsewhere) for case 2.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.