summaryrefslogtreecommitdiff
path: root/registry/registry.go
diff options
context:
space:
mode:
authorSilvan Jegen <s.jegen@gmail.com>2017-01-20 21:03:08 +0100
committerSilvan Jegen <s.jegen@gmail.com>2017-01-20 21:03:08 +0100
commit5c24009f2b1fd5a7e5abd4dc33ebdec0c6eaaf25 (patch)
tree7447a384efe6a5b45106fde621e53bdf38ad608a /registry/registry.go
parentba15251035961020363fa5aff95ff0a361023af9 (diff)
Introduce registry
We introduce a registry that contains maps to builder functions. These builder functions return the interface implementation of the modules specified in the configuration. We also make the input module type use the registry. All other module types still have to be converted.
Diffstat (limited to 'registry/registry.go')
-rw-r--r--registry/registry.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/registry/registry.go b/registry/registry.go
new file mode 100644
index 0000000..5b285b8
--- /dev/null
+++ b/registry/registry.go
@@ -0,0 +1,20 @@
+package registry
+
+import (
+ "github.com/Shugyousha/stasher/input"
+ "github.com/Shugyousha/stasher/work"
+)
+
+var (
+ Inputregistry map[string]func(map[string]string) input.Input
+ Filterregistry map[string]func(map[string]string) Filter
+ Outputregistry map[string]func(map[string]string) Output
+)
+
+type Filter interface {
+ Filter(*work.Work) *work.Work
+}
+
+type Output interface {
+ Output(*work.Work)
+}