schema

package
v1.4.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
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"
)
View Source
const (
	// EventName is the name of each server-sent event which is streamed to
	// a client watching events
	EventName = "event"

	// EventShutdown is the name of the server-sent event which is streamed
	// to a client watching events when the server stops, before the stream
	// ends, so the client knows it ended as there will be no more events
	EventShutdown = "shutdown"
)
View Source
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

View Source
var Queries string

Functions

This section is empty.

Types

type Event

type Event struct {
	Schema string `json:"schema,omitempty"`
	Table  string `json:"table,omitempty"`
	Action string `json:"action,omitempty"`
}

Event is a change which is published to the broadcaster's channel: what changed, such as a table of a schema, and how, such as INSERT, UPDATE or DELETE, as the database's triggers notify of their tables' changes

type EventFilter

type EventFilter struct {
	Schema string `json:"schema,omitempty" help:"returns only events of the schema"`
	Table  string `json:"table,omitempty" help:"returns only events of the table"`
	Action string `json:"action,omitempty" help:"returns only events of the action, such as INSERT, UPDATE or DELETE"`
}

EventFilter matches events: those with its schema, table and action, each of which matches any when it's empty

func (EventFilter) Matches

func (f EventFilter) Matches(event Event) bool

Matches returns true when the event has the filter's schema, table and action, each of which matches any when it's empty

func (EventFilter) Query

func (f EventFilter) Query() url.Values

Query returns the filter as the query of a request to watch events

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL