importers

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

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

New initializes an importer constructor

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL