Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mfs: make Root value a Directory #5170

Merged
merged 3 commits into from
Jul 16, 2018
Merged

mfs: make Root value a Directory #5170

merged 3 commits into from
Jul 16, 2018

Commits on Jun 29, 2018

  1. mfs: make Root value a Directory

    Make `Root` value explicitly a `Directory` structure instead of the `FSNode`
    interface (which also allowed the `File` type). This helps to make the code
    easier to reason about: the root of an MFS layout is always a directory, not a
    (single) file.
    
    Rename `GetValue()` to `GetDirectory()` to also make it more explicit, the
    renamed function now returns a `Directory` so there is no need for type
    assertions that were previously done on the `FSNode` interface to check that it
    was actually a `Directory`.
    
    `NewRoot()` now doesn't allow to create `Root` structures from DAG nodes that
    contain UnixFS files.
    
    License: MIT
    Signed-off-by: Lucas Molas <schomatis@gmail.com>
    schomatis committed Jun 29, 2018
    Configuration menu
    Copy the full SHA
    08922d2 View commit details
    Browse the repository at this point in the history
  2. mfs: remove unused Root variables node and Type

    License: MIT
    Signed-off-by: Lucas Molas <schomatis@gmail.com>
    schomatis committed Jun 29, 2018
    Configuration menu
    Copy the full SHA
    ba73385 View commit details
    Browse the repository at this point in the history
  3. mfs: remove DAGService from Root

    The `Root` structure now explicitly contains a `Directory` (instead of an
    `FSNode` interface), use that `Directory`'s `DAGService` instead of its own
    `dserv` variable (which was used only once in `closeChild()`). The `DAGService`
    in the `Root` and the `Directory` was the same (passed as an argument in the
    `NewRoot` initializer function).
    
    This leaves the `Root` structure with only a `Directory` and a `Republisher` and
    allows to better rethink its role and whether if those two structures should be
    grouped together (and if that group's name should be `Root`).
    
    License: MIT
    Signed-off-by: Lucas Molas <schomatis@gmail.com>
    schomatis committed Jun 29, 2018
    Configuration menu
    Copy the full SHA
    f5e7fe2 View commit details
    Browse the repository at this point in the history