aboutsummaryrefslogtreecommitdiffstats
path: root/bridge
diff options
context:
space:
mode:
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