subscan_plugin

package module
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

README

Subscan Plugin

The subscan plugin is an interface lib to subscan-essentials plugin, and Gen tool can automatically generate plugin templates

Install

go get github.com/itering/subscan-plugin

Usage

tutorial

Test

go test ./... -v
cd tools/gen-plugin && ./test_gen_tools.sh

LICENSE

GPL-3.0

Resource

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

type Plugin interface {
	// Init storage interface
	InitDao(d storage.Dao)

	// Init http router
	InitHttp() []router.Http

	// Receive Extrinsic data when subscribe extrinsic dispatch
	ProcessExtrinsic(*storage.Block, *storage.Extrinsic, []storage.Event) error

	// Receive Extrinsic data when subscribe extrinsic dispatch
	ProcessEvent(*storage.Block, *storage.Event, decimal.Decimal) error

	// Mysql tables schema auto migrate
	Migrate()

	// Subscribe Extrinsic with special module
	SubscribeExtrinsic() []string

	// Subscribe Events with special module
	SubscribeEvent() []string

	// Plugins version
	Version() string

	// Aims UI config
	UiConf() *UiConfig
}

type UiColumns

type UiColumns struct {
	Name  string `json:"name"`
	Label string `json:"label"`
}

type UiConfig

type UiConfig struct {
	Type string `json:"type"`
	Body struct {
		Type string `json:"type"`
		Api  struct {
			Method         string `json:"method"`
			Url            string `json:"url"`
			RequestAdaptor string `json:"requestAdaptor"`
			Adaptor        string `json:"adaptor"`
		} `json:"api"`
		SyncLocation  bool        `json:"syncLocation"`
		HeaderToolbar []string    `json:"headerToolbar"`
		Columns       []UiColumns `json:"columns"`
	} `json:"body"`
}

Directories

Path Synopsis
tools
gen-plugin
You can use the "packr clean" command to clean up this, and any other packr generated files.
You can use the "packr clean" command to clean up this, and any other packr generated files.
gen-plugin/packrd
You can use the "packr2 clean" command to clean up this, and any other packr generated files.
You can use the "packr2 clean" command to clean up this, and any other packr generated files.

Jump to

Keyboard shortcuts

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