-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. reuse CR definition of pkg/apis in all managers. 2. cleanup server. 3. fix db getClient bug, and optimize it. 4. rename wsclient to gmclient. 5. fix GetUniqueIdentifier bug. Signed-off-by: JimmyYang <yangjin39@huawei.com>
- Loading branch information
JimmyYang
authored and
llhuii
committed
Jan 28, 2021
1 parent
1540f7e
commit c4cfc1b
Showing
11 changed files
with
360 additions
and
466 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,36 @@ | ||
package gmclient | ||
|
||
const ( | ||
// InsertOperation is the insert value | ||
InsertOperation = "insert" | ||
// DeleteOperation is the delete value | ||
DeleteOperation = "delete" | ||
// StatusOperation is the status value | ||
StatusOperation = "status" | ||
) | ||
|
||
// Message defines message | ||
type Message struct { | ||
Header MessageHeader `json:"header"` | ||
Content []byte `json:"content"` | ||
} | ||
|
||
// MessageHeader define header of message | ||
type MessageHeader struct { | ||
Namespace string `json:"namespace"` | ||
ResourceKind string `json:"resourceKind"` | ||
ResourceName string `json:"resourceName"` | ||
Operation string `json:"operation"` | ||
} | ||
|
||
type MessageResourceHandler interface { | ||
GetName() string | ||
Insert(*Message) error | ||
Delete(*Message) error | ||
} | ||
|
||
type ClientI interface { | ||
Start() error | ||
WriteMessage(messageBody interface{}, messageHeader MessageHeader) error | ||
Subscribe(m MessageResourceHandler) error | ||
} |
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.