Skip to content

Commit

Permalink
fix/ssl-tests: bugs w/ flags on CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
mtulio committed Sep 30, 2019
1 parent f9baa8f commit 659c390
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.4.0-rc2
v0.4.0-rc3
2 changes: 2 additions & 0 deletions init.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ func initStkAPI() error {
log.Info("Initializing StatusCake API client...Success")

stkAPI.SetWaitInterval(uint32(config.StkInterval))
stkAPI.SetEnableTests(config.StkEnableTests)
stkAPI.SetEnableSSL(config.StkEnableSSL)

err = stkAPI.GatherAll()
if err != nil {
Expand Down
24 changes: 19 additions & 5 deletions stk/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,35 @@ func (stk *StkAPI) GetWaitInterval() uint32 {
return stk.waitIntervalSec
}

// SetEnableTests define API data scrape wait internval.
// SetEnableTests set Web Test flag to gather Tests.
func (stk *StkAPI) SetEnableTests(v bool) {
stk.EnableTests = v
}

// GetEnableTests return the wait interval value.
// GetEnableTests return the Flag to gather Web Tests.
func (stk *StkAPI) GetEnableTests() bool {
return stk.EnableTests
}

// SetEnableSSL set SSL flag to gather Tests.
func (stk *StkAPI) SetEnableSSL(v bool) {
stk.EnableTestsSSL = v
}

// GetEnableSSL return the SSL Flag to gather SSL Tests.
func (stk *StkAPI) GetEnableSSL() bool {
return stk.EnableTestsSSL
}

// GatherAll retrieves all data for enabled modules.
func (stk *StkAPI) GatherAll() error {
go stk.gatherTest()
go stk.gatherTestsData()
go stk.gatherTestsSSL()
if stk.EnableTests {
go stk.gatherTest()
go stk.gatherTestsData()
}
if stk.EnableTestsSSL {
go stk.gatherTestsSSL()
}
return nil
}

Expand Down

0 comments on commit 659c390

Please sign in to comment.