-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding client to pull requests for catalog (#184)
* Adding client to pull requests for catalog * Added changelog * adding client to pdfile
- Loading branch information
Showing
10 changed files
with
101 additions
and
0 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
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,10 @@ | ||
package models | ||
|
||
type AmplitudeEvent struct { | ||
EventType string `json:"event_type"` | ||
EventProperties map[string]interface{} `json:"event_properties"` | ||
UserProperties map[string]interface{} `json:"user_properties"` | ||
DeviceId string `json:"device_id"` | ||
UserId string `json:"user_id"` | ||
Origin string `json:"origin"` | ||
} |
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,29 @@ | ||
package processors | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/Parallels/prl-devops-service/basecontext" | ||
"github.com/Parallels/prl-devops-service/pdfile/diagnostics" | ||
"github.com/Parallels/prl-devops-service/pdfile/models" | ||
) | ||
|
||
type ClientCommandProcessor struct{} | ||
|
||
func (p ClientCommandProcessor) Process(ctx basecontext.ApiContext, line string, dest *models.PDFile) (bool, *diagnostics.PDFileDiagnostics) { | ||
diag := diagnostics.NewPDFileDiagnostics() | ||
command := getCommand(line) | ||
if command == nil { | ||
return false, diag | ||
} | ||
if command.Command != "CLIENT" { | ||
return false, diag | ||
} | ||
if command.Argument == "" { | ||
diag.AddError(errors.New("client command is missing argument")) | ||
} | ||
|
||
dest.Client = command.Argument | ||
ctx.LogDebugf("Processed by ClientCommandProcessor, line %v", line) | ||
return true, diag | ||
} |
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