Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Add a WithReifier method to allow easier derivation of non-unixfs pathing #23

Merged
merged 1 commit into from
Aug 11, 2021

Conversation

willscott
Copy link
Contributor

dependency injection in IPFS means we can only get a single non-parameterized injection of a fetcher.Factory or Resolver.

We provide a method for downstream interface based derivation of what sort of reification semantics are desired.

willscott added a commit to ipfs/kubo that referenced this pull request Aug 10, 2021
@aschmahmann
Copy link
Contributor

dependency injection in IPFS means we can only get a single non-parameterized injection of a fetcher.Factory or Resolver.

Without any judgement on this PR in particular, you can have multiple instances of the same type with go-ipfs's fx dependency injection you just need to do one of:

  1. Use a type alias (https://github.com/ipfs/go-ipfs/blob/0e73e235678e95e164b7e5e4f23d2b588bea7afd/core/node/libp2p/routing.go#L24)
  2. Use Go tags (example: https://github.com/ipfs/go-ipfs/blob/0e73e235678e95e164b7e5e4f23d2b588bea7afd/core/core.go#L103)

That aside having helper functions like WithReifier or allowing the reifier to be passed into the constructor as an option seem potentially useful.

@hannahhoward hannahhoward merged commit 5ca55a2 into main Aug 11, 2021
Jorropo pushed a commit to ipfs/go-libipfs-rapide that referenced this pull request Mar 23, 2023
Add a WithReifier method to allow easier derivation of non-unixfs pathing

This commit was moved from ipfs/go-fetcher@5ca55a2
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants