2018-09-21 19:23:46 +03:00
|
|
|
package core
|
|
|
|
|
|
|
|
import (
|
|
|
|
"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
|
|
|
|
Configure(repo repository.RepoCommon) (Configuration, error)
|
|
|
|
|
2018-09-24 18:21:24 +03:00
|
|
|
// ValidateConfig check the configuration for error
|
|
|
|
ValidateConfig(conf Configuration) error
|
|
|
|
|
2018-09-24 16:25:15 +03:00
|
|
|
// Importer return an Importer implementation if the import is supported
|
2018-09-21 19:23:46 +03:00
|
|
|
Importer() Importer
|
2018-09-24 16:25:15 +03:00
|
|
|
|
|
|
|
// Exporter return an Exporter implementation if the export is supported
|
2018-09-21 19:23:46 +03:00
|
|
|
Exporter() Exporter
|
|
|
|
}
|
2018-09-24 16:25:15 +03:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|