aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/core/interfaces.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-24 15:25:15 +0200
committerMichael Muré <batolettre@gmail.com>2018-09-24 15:25:15 +0200
commit5e8fb7ec5058b816ccc9622f52dbf1777254656c (patch)
tree76e27dff4c5128785e2e28e1544efff6fe398046 /bridge/core/interfaces.go
parent666586c5b92b64a64aea22927cfb3754861623a1 (diff)
downloadgit-bug-5e8fb7ec5058b816ccc9622f52dbf1777254656c.tar.gz
bridge: big refactor and cleanup
Diffstat (limited to 'bridge/core/interfaces.go')
-rw-r--r--bridge/core/interfaces.go26
1 files changed, 15 insertions, 11 deletions
diff --git a/bridge/core/interfaces.go b/bridge/core/interfaces.go
index 5336e7a8..5ead3c8f 100644
--- a/bridge/core/interfaces.go
+++ b/bridge/core/interfaces.go
@@ -7,23 +7,27 @@ import (
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
+ // Target return the target of the bridge (e.g.: "github")
+ Target() string
// Configure handle the user interaction and return a key/value configuration
// for future use
Configure(repo repository.RepoCommon) (Configuration, error)
+ // Importer return an Importer implementation if the import is supported
Importer() Importer
+
+ // Exporter return an Exporter implementation if the export is supported
Exporter() Exporter
}
+
+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
+}