2018-09-21 19:23:46 +03:00
|
|
|
package core
|
|
|
|
|
|
|
|
import (
|
2019-05-03 01:02:50 +03:00
|
|
|
"time"
|
|
|
|
|
2018-09-21 19:23:46 +03:00
|
|
|
"github.com/MichaelMure/git-bug/cache"
|
|
|
|
"github.com/MichaelMure/git-bug/repository"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Configuration map[string]string
|
|
|
|
|
|
|
|
type BridgeImpl interface {
|
2018-09-24 16:25:15 +03:00
|
|
|
// Target return the target of the bridge (e.g.: "github")
|
|
|
|
Target() string
|
2018-09-21 19:23:46 +03:00
|
|
|
|
|
|
|
// Configure handle the user interaction and return a key/value configuration
|
|
|
|
// for future use
|
2019-05-24 22:03:31 +03:00
|
|
|
Configure(repo repository.RepoCommon, params BridgeParams) (Configuration, error)
|
2018-09-21 19:23:46 +03:00
|
|
|
|
2018-09-24 18:21:24 +03:00
|
|
|
// ValidateConfig check the configuration for error
|
|
|
|
ValidateConfig(conf Configuration) error
|
|
|
|
|
2018-10-06 12:55:16 +03:00
|
|
|
// NewImporter return an Importer implementation if the import is supported
|
|
|
|
NewImporter() Importer
|
2018-09-24 16:25:15 +03:00
|
|
|
|
2018-10-06 12:55:16 +03:00
|
|
|
// NewExporter return an Exporter implementation if the export is supported
|
|
|
|
NewExporter() Exporter
|
2018-09-21 19:23:46 +03:00
|
|
|
}
|
2018-09-24 16:25:15 +03:00
|
|
|
|
|
|
|
type Importer interface {
|
2018-10-06 12:55:16 +03:00
|
|
|
Init(conf Configuration) error
|
2019-05-03 01:02:50 +03:00
|
|
|
ImportAll(repo *cache.RepoCache, since time.Time) error
|
2018-09-24 16:25:15 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
type Exporter interface {
|
2018-10-06 12:55:16 +03:00
|
|
|
Init(conf Configuration) error
|
2019-07-05 19:32:51 +03:00
|
|
|
ExportAll(repo *cache.RepoCache, since time.Time) (<-chan ExportResult, error)
|
2018-09-24 16:25:15 +03:00
|
|
|
}
|