1package core
2
3import (
4 "time"
5
6 "github.com/MichaelMure/git-bug/cache"
7 "github.com/MichaelMure/git-bug/repository"
8)
9
10type Configuration map[string]string
11
12type BridgeImpl interface {
13 // Target return the target of the bridge (e.g.: "github")
14 Target() string
15
16 // Configure handle the user interaction and return a key/value configuration
17 // for future use
18 Configure(repo repository.RepoCommon, params BridgeParams) (Configuration, error)
19
20 // ValidateConfig check the configuration for error
21 ValidateConfig(conf Configuration) error
22
23 // NewImporter return an Importer implementation if the import is supported
24 NewImporter() Importer
25
26 // NewExporter return an Exporter implementation if the export is supported
27 NewExporter() Exporter
28}
29
30type Importer interface {
31 Init(conf Configuration) error
32 ImportAll(repo *cache.RepoCache, since time.Time) error
33}
34
35type Exporter interface {
36 Init(conf Configuration) error
37 ExportAll(repo *cache.RepoCache, since time.Time) <-chan ExportResult
38}