interfaces.go

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