diff options
author | Silvan Jegen <s.jegen@gmail.com> | 2017-01-20 21:03:08 +0100 |
---|---|---|
committer | Silvan Jegen <s.jegen@gmail.com> | 2017-01-20 21:03:08 +0100 |
commit | 5c24009f2b1fd5a7e5abd4dc33ebdec0c6eaaf25 (patch) | |
tree | 7447a384efe6a5b45106fde621e53bdf38ad608a /registry | |
parent | ba15251035961020363fa5aff95ff0a361023af9 (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')
-rw-r--r-- | registry/registry.go | 20 |
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) +} |