mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 02:01:43 +03:00
44 lines
1.3 KiB
Go
44 lines
1.3 KiB
Go
package core
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"github.com/MichaelMure/git-bug/cache"
|
|
)
|
|
|
|
type Configuration map[string]string
|
|
|
|
type BridgeImpl interface {
|
|
// Target return the target of the bridge (e.g.: "github")
|
|
Target() string
|
|
|
|
// LoginMetaKey return the metadata key used to store the remote bug-tracker login
|
|
// on the user identity. The corresponding value is used to match identities and
|
|
// credentials.
|
|
LoginMetaKey() string
|
|
|
|
// Configure handle the user interaction and return a key/value configuration
|
|
// for future use
|
|
Configure(repo *cache.RepoCache, params BridgeParams) (Configuration, error)
|
|
|
|
// ValidateConfig check the configuration for error
|
|
ValidateConfig(conf Configuration) error
|
|
|
|
// NewImporter return an Importer implementation if the import is supported
|
|
NewImporter() Importer
|
|
|
|
// NewExporter return an Exporter implementation if the export is supported
|
|
NewExporter() Exporter
|
|
}
|
|
|
|
type Importer interface {
|
|
Init(repo *cache.RepoCache, conf Configuration) error
|
|
ImportAll(ctx context.Context, repo *cache.RepoCache, since time.Time) (<-chan ImportResult, error)
|
|
}
|
|
|
|
type Exporter interface {
|
|
Init(repo *cache.RepoCache, conf Configuration) error
|
|
ExportAll(ctx context.Context, repo *cache.RepoCache, since time.Time) (<-chan ExportResult, error)
|
|
}
|