aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/core
diff options
context:
space:
mode:
Diffstat (limited to 'bridge/core')
-rw-r--r--bridge/core/bridge.go47
-rw-r--r--bridge/core/interfaces.go8
2 files changed, 9 insertions, 46 deletions
diff --git a/bridge/core/bridge.go b/bridge/core/bridge.go
index b849bec6..aa02ceb5 100644
--- a/bridge/core/bridge.go
+++ b/bridge/core/bridge.go
@@ -6,6 +6,7 @@ import (
"reflect"
"regexp"
"strings"
+ "time"
"github.com/MichaelMure/git-bug/cache"
"github.com/MichaelMure/git-bug/repository"
@@ -265,7 +266,7 @@ func (b *Bridge) ensureInit() error {
return nil
}
-func (b *Bridge) ImportAll() error {
+func (b *Bridge) ImportAll(since time.Time) error {
importer := b.getImporter()
if importer == nil {
return ErrImportNotSupported
@@ -281,48 +282,10 @@ func (b *Bridge) ImportAll() error {
return err
}
- return importer.ImportAll(b.repo)
+ return importer.ImportAll(b.repo, since)
}
-func (b *Bridge) Import(id string) error {
- importer := b.getImporter()
- if importer == nil {
- return ErrImportNotSupported
- }
-
- err := b.ensureConfig()
- if err != nil {
- return err
- }
-
- err = b.ensureInit()
- if err != nil {
- return err
- }
-
- return importer.Import(b.repo, id)
-}
-
-func (b *Bridge) ExportAll() error {
- exporter := b.getExporter()
- if exporter == nil {
- return ErrExportNotSupported
- }
-
- err := b.ensureConfig()
- if err != nil {
- return err
- }
-
- err = b.ensureInit()
- if err != nil {
- return err
- }
-
- return exporter.ExportAll(b.repo)
-}
-
-func (b *Bridge) Export(id string) error {
+func (b *Bridge) ExportAll(since time.Time) error {
exporter := b.getExporter()
if exporter == nil {
return ErrExportNotSupported
@@ -338,5 +301,5 @@ func (b *Bridge) Export(id string) error {
return err
}
- return exporter.Export(b.repo, id)
+ return exporter.ExportAll(b.repo, since)
}
diff --git a/bridge/core/interfaces.go b/bridge/core/interfaces.go
index 4836dab3..be5afa62 100644
--- a/bridge/core/interfaces.go
+++ b/bridge/core/interfaces.go
@@ -1,6 +1,8 @@
package core
import (
+ "time"
+
"github.com/MichaelMure/git-bug/cache"
"github.com/MichaelMure/git-bug/repository"
)
@@ -27,12 +29,10 @@ type BridgeImpl interface {
type Importer interface {
Init(conf Configuration) error
- ImportAll(repo *cache.RepoCache) error
- Import(repo *cache.RepoCache, id string) error
+ ImportAll(repo *cache.RepoCache, since time.Time) error
}
type Exporter interface {
Init(conf Configuration) error
- ExportAll(repo *cache.RepoCache) error
- Export(repo *cache.RepoCache, id string) error
+ ExportAll(repo *cache.RepoCache, since time.Time) error
}