Documentation
¶
Index ¶
Constants ¶
const ( // DefaultSchema is the database schema when it isn't set DefaultSchema = "broadcaster" // NotifyChannel is the channel the broadcaster listens on, by default, // which the modules notify of their changes on NotifyChannel = "events" )
const ( // MaxPayloadSize is the largest event, as JSON, which can be published, // which is the largest notification Postgres sends, less a byte MaxPayloadSize = 7999 )
Variables ¶
var Queries string
Functions ¶
This section is empty.
Types ¶
type Notification ¶ added in v1.4.9
type Notification struct {
Schema string `json:"schema,omitempty"`
Table string `json:"table,omitempty"`
Action string `json:"action,omitempty"`
Row string `json:"row,omitempty"`
Data json.RawMessage `json:"data,omitempty"`
}
Notification is what's notified on the broadcaster's channel: by the database's triggers, whose action is INSERT, UPDATE or DELETE, as their TG_OP, or by Publish, whose action is create, update or delete. It says what changed, which is a table of a schema, and which row, or rows, changed, when it says, and what the table says of the change, when it says anything.