-
Notifications
You must be signed in to change notification settings - Fork 44
feat: OptionalString and UnixFSShardingSizeThreshold #149
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OptionalString
lgtm.
To avoid writing size parsers in multiple places, we may want to add Size
type similar to Duration
that takes care of serializing and deserializing bytes to human-readable form like "10GB"
, but this could be added in the future if we run out of time this week.
We can use go-humanize for the conversion since we already use it for this job in go-ipfs. e.g. https://github.com/ipfs/go-ipfs/blob/ef866a1400b3b2861e5e8b6cc9edc8633b890a0a/core/corerepo/stat.go#L81 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with ipfs/kubo#8527 and works as expected.
Note to self: we need OptionalString
in other places, so let's land this as-is and add dedicated type for humanized byte sizes in a separate PR.
Merging to unblock #150 which in turn will unblock sharness tests in libp2p update |
Also comes with a type definition for optional strings.