mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
For now, configs specified in `daemon --init-config` and `init CONFIG` are not available. We should fix this eventually but isn't necessary for now (and supporting this will be annoying).
26 lines
707 B
Go
26 lines
707 B
Go
package plugin
|
|
|
|
// Environment is the environment passed into the plugin on init.
|
|
type Environment struct {
|
|
// Path to the IPFS repo.
|
|
Repo string
|
|
|
|
// The plugin's config, if specified.
|
|
Config interface{}
|
|
}
|
|
|
|
// Plugin is base interface for all kinds of go-ipfs plugins
|
|
// It will be included in interfaces of different Plugins
|
|
type Plugin interface {
|
|
// Name should return unique name of the plugin
|
|
Name() string
|
|
|
|
// Version returns current version of the plugin
|
|
Version() string
|
|
|
|
// Init is called once when the Plugin is being loaded
|
|
// The plugin is passed an environment containing the path to the
|
|
// (possibly uninitialized) IPFS repo and the plugin's config.
|
|
Init(env *Environment) error
|
|
}
|