git-bug/bridge/core/interfaces.go

37 lines
1019 B
Go
Raw Normal View History

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
// 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
Importer() Importer
2018-09-24 16:25:15 +03:00
// Exporter return an Exporter implementation if the export is supported
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
}