Skip to content

Commit

Permalink
Review feedback: Add comment to HandleEntityAndDoMessage.MatchProps
Browse files Browse the repository at this point in the history
  • Loading branch information
jhrozek committed Oct 11, 2024
1 parent 7c4d8d5 commit 14aa03b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions internal/entities/handlers/message/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,15 @@ type EntityHint struct {

// HandleEntityAndDoMessage is a message that is sent to the entity handler to refresh an entity and perform an action.
type HandleEntityAndDoMessage struct {
Entity TypedProps `json:"entity"`
Originator TypedProps `json:"owner"`
Hint EntityHint `json:"hint"`
Entity TypedProps `json:"entity"`
Originator TypedProps `json:"owner"`
// Hint is used to help the entity handler find the entity upstream
// using the property service. A typical use case is to use the provider
// in the hint and an upstream ID in the Entity.GetByProps attribute
Hint EntityHint `json:"hint"`
// MatchProps is used to match the properties of the found entity. One
// use-case is to include the hook ID in the MatchProps to match against
// the entity's hook ID to avoid forwading the message to the wrong entity.
MatchProps map[string]any `json:"match_props"`
}

Expand Down

0 comments on commit 14aa03b

Please sign in to comment.