aboutsummaryrefslogtreecommitdiffstats
path: root/bridge
diff options
context:
space:
mode:
authorAmine Hilaly <hilalyamine@gmail.com>2019-05-24 21:03:31 +0200
committerAmine Hilaly <hilalyamine@gmail.com>2019-05-29 22:58:01 +0200
commitf124df7e73f8613bf9cd2f83177eeb4110c7a639 (patch)
tree6dbe45269279dbac92c12332e0049da9c47849a3 /bridge
parent8bfc65df6c4db01e74e5793fb4da402078b37648 (diff)
downloadgit-bug-f124df7e73f8613bf9cd2f83177eeb4110c7a639.tar.gz
changes to the BridgeImpl Interface
Add bridge params Change bridge.Configure signature
Diffstat (limited to 'bridge')
-rw-r--r--bridge/core/bridge.go13
-rw-r--r--bridge/core/interfaces.go2
2 files changed, 12 insertions, 3 deletions
diff --git a/bridge/core/bridge.go b/bridge/core/bridge.go
index aa02ceb5..6bc14bc7 100644
--- a/bridge/core/bridge.go
+++ b/bridge/core/bridge.go
@@ -20,6 +20,15 @@ const bridgeConfigKeyPrefix = "git-bug.bridge"
var bridgeImpl map[string]reflect.Type
+// BridgeParams holds parameters to simplify the bridge configuration without
+// having to make terminal prompts.
+type BridgeParams struct {
+ Owner string
+ Project string
+ URL string
+ Token string
+}
+
// Bridge is a wrapper around a BridgeImpl that will bind low-level
// implementation with utility code to provide high-level functions.
type Bridge struct {
@@ -166,8 +175,8 @@ func RemoveBridge(repo repository.RepoCommon, fullName string) error {
}
// Configure run the target specific configuration process
-func (b *Bridge) Configure() error {
- conf, err := b.impl.Configure(b.repo)
+func (b *Bridge) Configure(params BridgeParams) error {
+ conf, err := b.impl.Configure(b.repo, params)
if err != nil {
return err
}
diff --git a/bridge/core/interfaces.go b/bridge/core/interfaces.go
index be5afa62..37fdb3d7 100644
--- a/bridge/core/interfaces.go
+++ b/bridge/core/interfaces.go
@@ -15,7 +15,7 @@ type BridgeImpl interface {
// Configure handle the user interaction and return a key/value configuration
// for future use
- Configure(repo repository.RepoCommon) (Configuration, error)
+ Configure(repo repository.RepoCommon, params BridgeParams) (Configuration, error)
// ValidateConfig check the configuration for error
ValidateConfig(conf Configuration) error