-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Deduplicate networks * Addressed comments
- Loading branch information
1 parent
cfa64e0
commit 68beacb
Showing
18 changed files
with
944 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package common | ||
|
||
var ( | ||
verbose = false | ||
) | ||
|
||
// Verbose returns if verbose options is set | ||
func Verbose() bool { | ||
return verbose | ||
} | ||
|
||
// SetVerbose enables verbose mode | ||
func SetVerbose() { | ||
verbose = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
pkg/common/utils/test_utils.go → pkg/common/testutils/test_utils.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package utils | ||
package testutils | ||
|
||
import ( | ||
"testing" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package common | ||
|
||
import ( | ||
"log" | ||
) | ||
|
||
// (sigh, only if using reflection could be deemed "idigomatic"...) | ||
// Also don't put these into pkg/common/utils/util.go since utils package should not | ||
// depend on application specifics (for example, this common package). | ||
|
||
// RgnSvcPairSliceRemove removes an element from a RegionServicePair slice at the specified index | ||
func RgnSvcPairSliceRemove(in []*RegionServicePair, i int) []*RegionServicePair { | ||
if i < 0 || i >= len(in) { | ||
log.Panicf("Index out of bound: %d", i) | ||
} | ||
in[i] = in[len(in)-1] | ||
return in[:len(in)-1] | ||
} | ||
|
||
// SvcIPRangesSliceRemove removes an element from a ServiceIPRanges slice at the specified index | ||
func SvcIPRangesSliceRemove(in []*ServiceIPRanges, i int) []*ServiceIPRanges { | ||
if i < 0 || i >= len(in) { | ||
log.Panicf("Index out of bound: %d", i) | ||
} | ||
in[i] = in[len(in)-1] | ||
return in[:len(in)-1] | ||
} | ||
|
||
// RgnNetDetSliceRemove removes an element from a RegionNetworkDetail slice at the specified index | ||
func RgnNetDetSliceRemove(in []*RegionNetworkDetail, i int) []*RegionNetworkDetail { | ||
if i < 0 || i >= len(in) { | ||
log.Panicf("Index out of bound: %d", i) | ||
} | ||
in[i] = in[len(in)-1] | ||
return in[:len(in)-1] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.