From 5c24009f2b1fd5a7e5abd4dc33ebdec0c6eaaf25 Mon Sep 17 00:00:00 2001 From: Silvan Jegen Date: Fri, 20 Jan 2017 21:03:08 +0100 Subject: 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. --- registry/registry.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 registry/registry.go (limited to 'registry') 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) +} -- cgit v1.2.1-18-gbd029