aboutsummaryrefslogtreecommitdiffstats
path: root/indexer/interfaces.go
diff options
context:
space:
mode:
Diffstat (limited to 'indexer/interfaces.go')
-rw-r--r--indexer/interfaces.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/indexer/interfaces.go b/indexer/interfaces.go
new file mode 100644
index 000000000..f35bc6547
--- /dev/null
+++ b/indexer/interfaces.go
@@ -0,0 +1,19 @@
+package indexer
+
+// NewIndexerFuncName plugin looks up name.
+var NewIndexerFuncName = "NewIndexer"
+
+// NewIndexerFunc init function alias.
+type NewIndexerFunc = func(ReadOnlyBlockChain, Config) Indexer
+
+// Indexer defines indexer daemon interface. The daemon would hold a
+// core.Blockhain, passed by initialization function, to receiving latest block
+// event or other information query and interaction.
+type Indexer interface {
+ // Start is called by dex.Dexon if config is set.
+ Start() error
+
+ // Stop is called by dex.Dexon if config is set and procedure is
+ // terminating.
+ Stop() error
+}