Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

IPLD Schema for UnixFSv2 #29

Closed
mikeal opened this issue Aug 21, 2019 · 1 comment
Closed

IPLD Schema for UnixFSv2 #29

mikeal opened this issue Aug 21, 2019 · 1 comment

Comments

@mikeal
Copy link
Contributor

mikeal commented Aug 21, 2019

Below is the first draft of an IPLD Schema for a UnixFSv2 that we could build and ship this year.

The implementation of the advanced layouts is yet to be defined.

If this seems reasonable I’ll take this, along with any modifications, and turn it into a larger pull request to replace the current spec.

type Files union {
  | Map “map”
  | Hamt “hamt”
} representation keyed

type FileUnion union {
  | File “file”
  | &File “fileLink”
} representation keyed

type Hamt {String:FileUnion}<HAMT>

advanced HAMT {
  implementation "IPLD/experimental/HAMT/v1"
}

type Directory struct {
  name optional String
  size optional Int
  files Files
}

advanced ByteListLayout {
  # array of bytes or links to bytes
}

advanced FlatListLayout {
  # balanced flat tree w/ max leaf size of bytes
}

type ByteList bytes<ByteListLayout>
type FlatList bytes<FlatListLayout>

type Data union {
  | Bytes “bytes”
  | &Bytes “bytesLink”
  | ByteList “bytesList”
  | &ByteList “bytesListLink”
  | FlatList “flatList”
  | &FlatList “flatListLink”
} representation keyed

type Permissions struct {
  uid Int
  gid Int
  posix Int # The standard 0777 bitpacking masks
  
  sticky Bool (implicit: false)
  setuid Bool (implicit: false)
  setgid Bool (implicit: false)
}

type Attributes struct {
  mtime optional Int
  atime optional Int
  ctime optional Int
  mtime64 optional Int
  atime64 optional Int
  ctime64 optional Int
  
  permissions optional Permissions
 
  devMajor optional Int
  devMinor optional Int
}

type File struct {
  name optional String
  data optional Data
  dataLink optional &Data
}
@mikeal
Copy link
Contributor Author

mikeal commented Oct 19, 2019

Closing this for now. There’s a new and much better schema being built in the implementation.

The data layout part of that has been posted as its own spec for IPLD ipld/specs#211

@mikeal mikeal closed this as completed Oct 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant