Skip to content

Commit

Permalink
added message properties
Browse files Browse the repository at this point in the history
Signed-off-by: Amir Malka <amirm@armosec.io>
  • Loading branch information
amirmalka committed Nov 7, 2023
1 parent 803b507 commit 0249728
Showing 1 changed file with 59 additions and 54 deletions.
113 changes: 59 additions & 54 deletions pulsar/common/synchronizer/messages.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
package synchronizer

const (
MsgPropTimestamp = "timestamp"
// MsgPropCluster is the property name for the cluster name
MsgPropCluster = "cluster"
// MsgPropAccount is the property name for the account name
MsgPropAccount = "account"
// MsgPropEvent is the property name for the event type
MsgPropEvent = "event"
MsgPropEventValueGetObjectMessage = "GetObject"
Expand All @@ -16,78 +21,78 @@ const (
// structs for Pulsar messages for synchronizer topic

type DeleteObjectMessage struct {
ClusterName string `json:"clusterName"`
CustomerGUID string `json:"customerGUID,omitempty" bson:"customerGUID,omitempty"`
Depth int `json:"depth"`
Kind string `json:"kind"`
MsgId string `json:"msgId"`
Name string `json:"name"`
Cluster string `json:"cluster"`
Account string `json:"account"`
Depth int `json:"depth"`
Kind string `json:"kind"`
MsgId string `json:"msgId"`
Name string `json:"name"`
}

type GetObjectMessage struct {
BaseObject []byte `json:"baseObject"`
ClusterName string `json:"clusterName"`
CustomerGUID string `json:"customerGUID,omitempty" bson:"customerGUID,omitempty"`
Depth int `json:"depth"`
Kind string `json:"kind"`
MsgId string `json:"msgId"`
Name string `json:"name"`
BaseObject []byte `json:"baseObject"`
Cluster string `json:"cluster"`
Account string `json:"account"`
Depth int `json:"depth"`
Kind string `json:"kind"`
MsgId string `json:"msgId"`
Name string `json:"name"`
}

type NewChecksumMessage struct { // How is this different from VerifyObjectMessage?
Checksum string `json:"checksum"`
ClusterName string `json:"clusterName"`
CustomerGUID string `json:"customerGUID,omitempty" bson:"customerGUID,omitempty"`
Depth int `json:"depth"`
Kind string `json:"kind"`
MsgId string `json:"msgId"`
Name string `json:"name"`
type NewChecksumMessage struct {
Checksum string `json:"checksum"`
Cluster string `json:"cluster"`
Account string `json:"account"`
Depth int `json:"depth"`
Kind string `json:"kind"`
MsgId string `json:"msgId"`
Name string `json:"name"`
}

type NewObjectMessage struct {
ClusterName string `json:"clusterName"`
CustomerGUID string `json:"customerGUID,omitempty" bson:"customerGUID,omitempty"`
Depth int `json:"depth"`
Kind string `json:"kind"`
MsgId string `json:"msgId"`
Name string `json:"name"`
Object []byte `json:"patch"`
Cluster string `json:"cluster"`
Account string `json:"account"`
Depth int `json:"depth"`
Kind string `json:"kind"`
MsgId string `json:"msgId"`
Name string `json:"name"`
Object []byte `json:"patch"`
}

type PatchObjectMessage struct {
Checksum string `json:"checksum"`
ClusterName string `json:"clusterName"`
CustomerGUID string `json:"customerGUID,omitempty" bson:"customerGUID,omitempty"`
Depth int `json:"depth"`
Kind string `json:"kind"`
MsgId string `json:"msgId"`
Name string `json:"name"`
Patch []byte `json:"patch"`
Checksum string `json:"checksum"`
Cluster string `json:"cluster"`
Account string `json:"account"`
Depth int `json:"depth"`
Kind string `json:"kind"`
MsgId string `json:"msgId"`
Name string `json:"name"`
Patch []byte `json:"patch"`
}

type PutObjectMessage struct {
ClusterName string `json:"clusterName"`
CustomerGUID string `json:"customerGUID,omitempty" bson:"customerGUID,omitempty"`
Depth int `json:"depth"`
Kind string `json:"kind"`
MsgId string `json:"msgId"`
Name string `json:"name"`
Object []byte `json:"patch"`
Cluster string `json:"cluster"`
Account string `json:"account"`
Depth int `json:"depth"`
Kind string `json:"kind"`
MsgId string `json:"msgId"`
Name string `json:"name"`
Object []byte `json:"patch"`
}

type VerifyObjectMessage struct {
Checksum string `json:"checksum"`
ClusterName string `json:"clusterName"`
CustomerGUID string `json:"customerGUID,omitempty" bson:"customerGUID,omitempty"`
Depth int `json:"depth"`
Kind string `json:"kind"`
MsgId string `json:"msgId"`
Name string `json:"name"`
Checksum string `json:"checksum"`
Cluster string `json:"cluster"`
Account string `json:"account"`
Depth int `json:"depth"`
Kind string `json:"kind"`
MsgId string `json:"msgId"`
Name string `json:"name"`
}

type ServerConnectedMessage struct {
ClusterName string `json:"clusterName"`
CustomerGUID string `json:"customerGUID,omitempty" bson:"customerGUID,omitempty"`
Depth int `json:"depth"`
MsgId string `json:"msgId"`
Cluster string `json:"cluster"`
Account string `json:"account"`
Depth int `json:"depth"`
MsgId string `json:"msgId"`
}

0 comments on commit 0249728

Please sign in to comment.