aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/core/interfaces.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-21 18:23:46 +0200
committerMichael Muré <batolettre@gmail.com>2018-09-21 18:53:44 +0200
commit921cd18cf98ecfc1f7fa82f57d64f1b1f9077e64 (patch)
treedfd7fea5be54c6020ed6773fbdefbaeb5cd2a78e /bridge/core/interfaces.go
parent82eaceffc1d750832a2a66f206749d2dca968cce (diff)
downloadgit-bug-921cd18cf98ecfc1f7fa82f57d64f1b1f9077e64.tar.gz
bridge: better interfaces, working github configurator
Diffstat (limited to 'bridge/core/interfaces.go')
-rw-r--r--bridge/core/interfaces.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/bridge/core/interfaces.go b/bridge/core/interfaces.go
new file mode 100644
index 00000000..5336e7a8
--- /dev/null
+++ b/bridge/core/interfaces.go
@@ -0,0 +1,29 @@
+package core
+
+import (
+ "github.com/MichaelMure/git-bug/cache"
+ "github.com/MichaelMure/git-bug/repository"
+)
+
+type Configuration map[string]string
+
+type Importer interface {
+ ImportAll(repo *cache.RepoCache, conf Configuration) error
+ Import(repo *cache.RepoCache, conf Configuration, id string) error
+}
+
+type Exporter interface {
+ ExportAll(repo *cache.RepoCache, conf Configuration) error
+ Export(repo *cache.RepoCache, conf Configuration, id string) error
+}
+
+type BridgeImpl interface {
+ Name() string
+
+ // Configure handle the user interaction and return a key/value configuration
+ // for future use
+ Configure(repo repository.RepoCommon) (Configuration, error)
+
+ Importer() Importer
+ Exporter() Exporter
+}