-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Comcast/standUpMachine
Initial skeleton for Tr1d1um (WIP)
- Loading branch information
Showing
9 changed files
with
947 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package main | ||
|
||
const( | ||
COMMAND_GET = "GET" | ||
COMMAND_GET_ATTRS = "GET_ATTRIBUTES" | ||
COMMAND_SET = "SET" | ||
COMMAND_SET_ATTRS = "SET_ATTRIBUTES" | ||
COMMAND_TEST_SET = "TEST_AND_SET" | ||
COMMAND_ADD_ROW = "ADD_ROW" | ||
COMMAND_DELETE_ROW = "DELETE_ROW" | ||
COMMAND_REPLACE_ROWS = "REPLACE_ROWS" | ||
|
||
HEADER_WPA_SYNC_OLD_CID = "X-Webpa-Sync-Old-Cid" | ||
HEADER_WPA_SYNC_NEW_CID = "X-Webpa-Sync-New-Cid" | ||
HEADER_WPA_SYNC_CMC = "X-Webpa-Sync-Cmc" | ||
|
||
ERR_UNSUCCESSFUL_DATA_PARSE = "Unsuccessful Data Parse" | ||
) | ||
/* | ||
GET-Flavored structs | ||
*/ | ||
|
||
type GetWDMP struct { | ||
Command string `json:"command"` | ||
Names []string `json:"names,omitempty"` | ||
Attribute string `json:"attributes,omitempty"` | ||
} | ||
|
||
/* | ||
SET-Flavored structs | ||
*/ | ||
|
||
type Attr map[string]interface{} | ||
|
||
type SetParam struct { | ||
Name* string `json:"name"` | ||
DataType* int32 `json:"dataType,omitempty"` | ||
Value interface{} `json:"value,omitempty"` | ||
Attributes Attr `json:"attributes,omitempty"` | ||
} | ||
|
||
type SetWDMP struct { | ||
Command string `json:"command"` | ||
OldCid string `json:"old-cid,omitempty"` | ||
NewCid string `json:"new-cid,omitempty"` | ||
SyncCmc string `json:"sync-cmc,omitempty"` | ||
Parameters []SetParam `json:"parameters,omitempty"` | ||
} | ||
|
||
/* | ||
Row-related command structs | ||
*/ | ||
|
||
type AddRowWDMP struct { | ||
Command string `json:"command"` | ||
Table string `json:"table"` | ||
Row map[string]string `json:"row"` | ||
} | ||
|
||
type ReplaceRowsWDMP struct { | ||
Command string `json:"command"` | ||
Table string `json:"table"` | ||
Rows map[string]map[string]string `json:"rows"` | ||
} | ||
|
||
type DeleteRowWDMP struct { | ||
Command string `json:"command"` | ||
Row string `json:"row"` | ||
} | ||
|
Oops, something went wrong.