ipld / specs

Content-addressed, authenticated, immutable data structures
Other
592 stars 108 forks source link

selectors: improve UnixfsV1 example #202

Closed vmx closed 5 years ago

vmx commented 5 years ago

The old example was hard to understand if you didn't really know how UnixFSv1 is structured. The second selector example was removed as it actually wasn't accurate and solely based on some prototyping work I did some time ago.

I'm really way more happy with this example now :)

warpfork commented 5 years ago

Good examples are hard to refine, thank you so much for driving this :)

vmx commented 5 years ago

I thought I've left a comment, but apparently I didn't.

@rvagg, @warpfork: Could you please review it again? I changed the whole example, so the approval is not accurate anymore.

warpfork commented 5 years ago

Updated example LGTM :+1:

rvagg commented 5 years ago

Here's a bonus optional extra, when introducing the example data structure you could also do it with IPLD schemas:

type Example struct {
  data Any
  links [Link]
}

type Link struct {
  name String
  cid &Example
}

(that data Any isn't technically right, but it's directionally right and I think we might end up with such a construct sometime, soon?).

vmx commented 5 years ago

@rvagg Using IPLD Schemas for describing the structure is an excellent idea. Time for another quick review :)