From f124df7e73f8613bf9cd2f83177eeb4110c7a639 Mon Sep 17 00:00:00 2001 From: Amine Hilaly Date: Fri, 24 May 2019 21:03:31 +0200 Subject: changes to the BridgeImpl Interface Add bridge params Change bridge.Configure signature --- bridge/core/bridge.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'bridge/core/bridge.go') 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 } -- cgit