14 lines
267 B
Go
14 lines
267 B
Go
|
|
package websocket
|
||
|
|
|
||
|
|
import "encoding/json"
|
||
|
|
|
||
|
|
type Event struct {
|
||
|
|
Table string `json:"table"`
|
||
|
|
Action string `json:"action"` // INSERT, UPDATE, DELETE
|
||
|
|
CompanyID string `json:"company_id"`
|
||
|
|
}
|
||
|
|
|
||
|
|
func (e *Event) Marshal() ([]byte, error) {
|
||
|
|
return json.Marshal(e)
|
||
|
|
}
|