Skip to content

ipld plugin: refactor to make it injectable #150

@liamsi

Description

@liamsi

As far as I understand, go plugins need to be defined in a main package to work properly (-buildmode=plugin requires exactly one main package).

That's the approach we took in #144:
https://github.com/lazyledger/lazyledger-core/blob/dbd2daf493669489abd16e94c315596d6504c667/p2p/ipld/plugin/plugin.go#L1

It seems possible to load the plugin using loader.Preload though:
https://github.com/ipfs/go-ipfs/blob/7588a6a52a789fa951e1c4916cee5c7a304912c2/plugin/loader/loader.go#L28

That would only work if the Plugin was in an importable lib/package (not main). Ideally, both would be possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C:dhtDHT and p2p related issues (IPFS mostly)T:enhancementType: Enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions