Skip to content

gateway: post-extraction GO API cleanup #61

@hacdias

Description

@hacdias

We're currently working on extracting the Gateway code from kubo to go-libipfs (ipfs/kubo#8524). After the extraction, we should improve the code, such that it is more useable. There are currently a few points that, in my opinion, make the Gateway handler harder to use than it should:

  1. It requires more APIs than necessary.
    • From NodeAPI.Block(), we only use Get and Stat, but we are requiring the full interface (Get, Put, Rm, Stat).
    • From NodeAPI.Dag(), we only use Get, but we are requiring the full APIDagService interface, which contains a lot more functions.
  2. The handler requires both an online and offline APIs. The offline API is only used once with the Dag().Get function. Perhaps we could add an option to that method Offline: true or LocalOnly: true or NoFetch: true instead. This would allow us to only require the consumers of the Gateway code to provide one Node API.

Things to do:

Metadata

Metadata

Assignees

No one assigned

    Labels

    need/triageNeeds initial labeling and prioritizationtopic/gatewayIssues related to HTTP Gateway

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions