go-ipfs: github.com/ipfs/go-ipfs/plugin Index | Files | Directories

package plugin

import "github.com/ipfs/go-ipfs/plugin"

Index

Package Files

daemon.go datastore.go ipld.go plugin.go tracer.go

type Environment Uses

type Environment struct {
    // Path to the IPFS repo.
    Repo string

    // The plugin's config, if specified.
    Config interface{}
}

Environment is the environment passed into the plugin on init.

type Plugin Uses

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
}

Plugin is the base interface for all kinds of go-ipfs plugins It will be included in interfaces of different Plugins

Optionally, Plugins can implement io.Closer if they want to have a termination step when unloading.

type PluginDaemon Uses

type PluginDaemon interface {
    Plugin

    Start(coreiface.CoreAPI) error
}

PluginDaemon is an interface for daemon plugins. These plugins will be run on the daemon and will be given access to an implementation of the CoreAPI.

type PluginDatastore Uses

type PluginDatastore interface {
    Plugin

    DatastoreTypeName() string
    DatastoreConfigParser() fsrepo.ConfigFromMap
}

PluginDatastore is an interface that can be implemented to add handlers for for different datastores

type PluginIPLD Uses

type PluginIPLD interface {
    Plugin

    RegisterBlockDecoders(dec ipld.BlockDecoder) error
    RegisterInputEncParsers(iec coredag.InputEncParsers) error
}

PluginIPLD is an interface that can be implemented to add handlers for for different IPLD formats

type PluginTracer Uses

type PluginTracer interface {
    Plugin

    InitTracer() (opentracing.Tracer, error)
}

PluginTracer is an interface that can be implemented to add a tracer

Directories

PathSynopsis
loader
plugins/badgerds
plugins/flatfs
plugins/git
plugins/levelds

Package plugin imports 5 packages (graph) and is imported by 25 packages. Updated 2019-09-26. Refresh now. Tools for package owners.