-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace connection test result with structure from model package (#2259)
- Loading branch information
1 parent
98d258c
commit c9db177
Showing
22 changed files
with
208 additions
and
153 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
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,35 @@ | ||
package model | ||
|
||
type ConnectionResult struct { | ||
PortCheck ConnectionTestStep | ||
Connectivity ConnectionTestStep | ||
Authentication ConnectionTestStep | ||
FetchTraces ConnectionTestStep | ||
} | ||
|
||
func (c ConnectionResult) HasSucceed() bool { | ||
return c.Connectivity.HasSucceed() && c.Authentication.HasSucceed() && c.FetchTraces.HasSucceed() | ||
} | ||
|
||
type ConnectionTestStep struct { | ||
Passed bool | ||
Status Status | ||
Message string | ||
Error error | ||
} | ||
|
||
func (r *ConnectionTestStep) HasSucceed() bool { | ||
if r == nil { | ||
return true | ||
} | ||
|
||
return r.Error == nil | ||
} | ||
|
||
func (r *ConnectionTestStep) IsSet() bool { | ||
if r == nil { | ||
return false | ||
} | ||
|
||
return r.Message != "" | ||
} |
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,49 @@ | ||
package model | ||
|
||
import "time" | ||
|
||
type ( | ||
Protocol string | ||
Status string | ||
) | ||
|
||
var ( | ||
ProtocolHTTP Protocol = "http" | ||
ProtocolGRPC Protocol = "grpc" | ||
) | ||
|
||
var ( | ||
StatusPassed Status = "passed" | ||
StatusWarning Status = "warning" | ||
StatusFailed Status = "failed" | ||
) | ||
|
||
type TestRunEvent struct { | ||
Type string | ||
Stage string | ||
Description string | ||
CreatedAt time.Time | ||
TestId string | ||
RunId string | ||
DataStoreConnection ConnectionResult | ||
Polling PollingInfo | ||
Outputs []OutputInfo | ||
} | ||
|
||
type PollingInfo struct { | ||
Type string | ||
ReasonNextIteration string | ||
IsComplete bool | ||
Periodic *PeriodicPollingConfig | ||
} | ||
|
||
type PeriodicPollingConfig struct { | ||
NumberSpans int32 | ||
NumberIterations int32 | ||
} | ||
|
||
type OutputInfo struct { | ||
LogLevel string | ||
Message string | ||
OutputName string | ||
} |
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
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
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.