Merge pull request #283 from gabriel-samfira/add-json-tags

Add JSON tags to the ChangePayload struct
This commit is contained in:
Gabriel 2024-08-06 16:53:12 +03:00 committed by GitHub
commit 56b0e6065a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View file

@ -6,7 +6,7 @@ import (
type Filter struct {
Operations []common.OperationType `json:"operations"`
EntityType common.DatabaseEntityType `json:"entity_type"`
EntityType common.DatabaseEntityType `json:"entity-type"`
}
func (f Filter) Validate() error {
@ -30,7 +30,7 @@ func (f Filter) Validate() error {
}
type Options struct {
SendEverything bool `json:"send_everything"`
SendEverything bool `json:"send-everything"`
Filters []Filter `json:"filters"`
}

View file

@ -28,9 +28,9 @@ const (
)
type ChangePayload struct {
EntityType DatabaseEntityType
Operation OperationType
Payload interface{}
EntityType DatabaseEntityType `json:"entity-type"`
Operation OperationType `json:"operation"`
Payload interface{} `json:"payload"`
}
type Consumer interface {