Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FieldRedactions ¶
FieldRedactions describes how redaction fields are specified. Top level map key is the schema, inner map key is the table and slice is the fields to redact.
func DecodeRedactions ¶
func DecodeRedactions(r string) (FieldRedactions, error)
DecodeRedactions returns a FieldRedactions map decoded from redactions specified in json format.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements PQStreamServer and manages both client connections and database event monitoring.
func NewServer ¶
func NewServer(connectionString string, opts ...ServerOption) (*Server, error)
NewServer prepares a new pqstream server.
func (*Server) HandleEvents ¶
HandleEvents processes events from the database and copies them to relevant clients.
func (*Server) InstallTriggers ¶
InstallTriggers sets up triggers to start observing changes for the set of tables in the database.
func (*Server) Listen ¶
func (s *Server) Listen(r *pqs.ListenRequest, srv pqs.PQStream_ListenServer) error
Listen handles a request to listen for database events and streams them to clients.
func (*Server) RemoveTriggers ¶
RemoveTriggers removes triggers from the database.
type ServerOption ¶
type ServerOption func(*Server)
ServerOption allows customization of a new server.
func WithContext ¶
func WithContext(ctx context.Context) ServerOption
WithContext allows supplying a custom context.
func WithFieldRedactions ¶
func WithFieldRedactions(r FieldRedactions) ServerOption
WithFieldRedactions controls which fields are redacted from the feed.
func WithLogger ¶
func WithLogger(l logrus.FieldLogger) ServerOption
WithLogger allows attaching a custom logger.
func WithTableRegexp ¶
func WithTableRegexp(re *regexp.Regexp) ServerOption
WithTableRegexp controls which tables are managed.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
pqs
pqs is the client for psqd which allows subscription to change events in a postgres database cluster.
|
pqs is the client for psqd which allows subscription to change events in a postgres database cluster. |
pqsd
pqsd is an agent that connects to a postgresql cluster and manages stream emission.
|
pqsd is an agent that connects to a postgresql cluster and manages stream emission. |
contrib
|
|
cmd/pqsamq
pqs is the client for psqd which allows subscription to change events in a postgres database cluster.
|
pqs is the client for psqd which allows subscription to change events in a postgres database cluster. |
Package pqs is a generated protocol buffer package.
|
Package pqs is a generated protocol buffer package. |