Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Importers = make(map[string]ImporterConstructor)
Importers are the constructors to build importer plugins.
Functions ¶
func Register ¶
func Register(name string, constructor ImporterConstructor)
Register is used to register Constructor implementations. This mechanism allows for loose coupling between the configuration and the implementation. It is extremely similar to the way sql.DB drivers are configured and used.
Types ¶
type Importer ¶
type Importer interface { // Plugin - implement this interface. plugins.Plugin // GetGenesis returns the genesis object for the network. // It may only be called after Init(). GetGenesis() (*sdk.Genesis, error) // GetBlock given any round number-rnd fetches the block at that round. // It returns an object of type BlockData defined in data. GetBlock(rnd uint64) (data.BlockData, error) }
Importer defines the interface for importer plugins
type ImporterConstructor ¶ added in v1.3.0
type ImporterConstructor interface { // New should return an instantiation of a Importer. // Configuration values should be passed and can be processed during `Init()`. New() Importer }
ImporterConstructor must be implemented by each Importer. It provides a basic no-arg constructor for instances of an ImporterImpl.
func ImporterConstructorByName ¶ added in v1.3.0
func ImporterConstructorByName(name string) (ImporterConstructor, error)
ImporterConstructorByName returns a Importer constructor for the name provided
type ImporterConstructorFunc ¶
type ImporterConstructorFunc func() Importer
ImporterConstructorFunc is Constructor implementation for importers
func (ImporterConstructorFunc) New ¶
func (f ImporterConstructorFunc) New() Importer
New initializes an importer constructor
Click to show internal directories.
Click to hide internal directories.