-
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.
- Loading branch information
1 parent
034f530
commit 315b7c1
Showing
17 changed files
with
162 additions
and
94 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package activities | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/mentos1386/zdravko/database/models" | ||
"github.com/mentos1386/zdravko/internal/server/services" | ||
"github.com/mentos1386/zdravko/internal/temporal" | ||
) | ||
|
||
func (a *Activities) AddTargetHistory(ctx context.Context, param temporal.ActivityAddTargetHistoryParam) (*temporal.ActivityAddTargetHistoryResult, error) { | ||
|
||
status := models.TargetStatusUnknown | ||
if param.Status == temporal.AddTargetHistoryStatusSuccess { | ||
status = models.TargetStatusSuccess | ||
} | ||
if param.Status == temporal.AddTargetHistoryStatusFailure { | ||
status = models.TargetStatusFailure | ||
} | ||
|
||
err := services.AddHistoryForTarget(ctx, a.db, &models.TargetHistory{ | ||
TargetId: param.Target.Id, | ||
Status: status, | ||
Note: param.Note, | ||
}) | ||
|
||
return &temporal.ActivityAddTargetHistoryResult{}, err | ||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -85,7 +85,7 @@ filter: | | |
target: | | ||
kind: Http | ||
tags: | ||
labels: | ||
production: "true" | ||
spec: | ||
url: "https://test.k6.io" | ||
|
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,20 @@ | ||
package temporal | ||
|
||
type AddTargetHistoryStatus string | ||
|
||
const ( | ||
AddTargetHistoryStatusSuccess AddTargetHistoryStatus = "SUCCESS" | ||
AddTargetHistoryStatusFailure AddTargetHistoryStatus = "FAILURE" | ||
AddTargetHistoryStatusUnknown AddTargetHistoryStatus = "UNKNOWN" | ||
) | ||
|
||
type ActivityAddTargetHistoryParam struct { | ||
Target *Target | ||
Status AddTargetHistoryStatus | ||
Note string | ||
} | ||
|
||
type ActivityAddTargetHistoryResult struct { | ||
} | ||
|
||
const ActivityAddTargetHistoryName = "ADD_TARGET_HISTORY" |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -13,6 +13,7 @@ import ( | |
) | ||
|
||
type Target struct { | ||
Id string | ||
Name string | ||
Group string | ||
Metadata 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1 @@ | ||
package api | ||
|
||
type CheckStatus string | ||
|
||
const ( | ||
CheckStatusSuccess CheckStatus = "SUCCESS" | ||
CheckStatusFailure CheckStatus = "FAILURE" | ||
CheckStatusUnknown CheckStatus = "UNKNOWN" | ||
) | ||
|
||
type ApiV1ChecksHistoryPOSTBody struct { | ||
Status CheckStatus `json:"status"` | ||
Note string `json:"note"` | ||
WorkerGroupId string `json:"worker_group"` | ||
} |
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.