Skip to content

Commit

Permalink
Merge pull request #1 from Comcast/standUpMachine
Browse files Browse the repository at this point in the history
Initial skeleton for Tr1d1um (WIP)
  • Loading branch information
schmidtw authored Sep 15, 2017
2 parents e086f51 + 6f0c952 commit 0e1c127
Show file tree
Hide file tree
Showing 9 changed files with 947 additions and 3 deletions.
111 changes: 111 additions & 0 deletions src/glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ homepage: https://github.com/Comcast/tr1d1um
import:
- package: github.com/Comcast/webpa-common
version: cb246362b61aaf042a936fa615a48554d111f9b4

70 changes: 70 additions & 0 deletions src/tr1d1um/WDMP_Type.go
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"`
}

Loading

0 comments on commit 0e1c127

Please sign in to comment.