pqs

package
v0.0.0-...-c9027a0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package pqs is a generated protocol buffer package.

It is generated from these files:

pqstream.proto

It has these top-level messages:

ListenRequest
RawEvent
Event

Index

Constants

This section is empty.

Variables

View Source
var Operation_name = map[int32]string{
	0: "UNKNOWN",
	1: "INSERT",
	2: "UPDATE",
	3: "DELETE",
	4: "TRUNCATE",
}
View Source
var Operation_value = map[string]int32{
	"UNKNOWN":  0,
	"INSERT":   1,
	"UPDATE":   2,
	"DELETE":   3,
	"TRUNCATE": 4,
}

Functions

func RegisterPQStreamServer

func RegisterPQStreamServer(s *grpc.Server, srv PQStreamServer)

Types

type Event

type Event struct {
	Schema string    `protobuf:"bytes,1,opt,name=schema" json:"schema,omitempty"`
	Table  string    `protobuf:"bytes,2,opt,name=table" json:"table,omitempty"`
	Op     Operation `protobuf:"varint,3,opt,name=op,enum=pqs.Operation" json:"op,omitempty"`
	// if the id column exists, this will populate it
	Id string `protobuf:"bytes,4,opt,name=id" json:"id,omitempty"`
	// payload is a json encoded representation of the changed object.
	Payload *google_protobuf.Struct `protobuf:"bytes,5,opt,name=payload" json:"payload,omitempty"`
	// changes is, in the event of op==UPDATE an RFC7386 JSON merge patch.
	Changes *google_protobuf.Struct `protobuf:"bytes,6,opt,name=changes" json:"changes,omitempty"`
}

A database event.

func (*Event) Descriptor

func (*Event) Descriptor() ([]byte, []int)

func (*Event) GetChanges

func (m *Event) GetChanges() *google_protobuf.Struct

func (*Event) GetId

func (m *Event) GetId() string

func (*Event) GetOp

func (m *Event) GetOp() Operation

func (*Event) GetPayload

func (m *Event) GetPayload() *google_protobuf.Struct

func (*Event) GetSchema

func (m *Event) GetSchema() string

func (*Event) GetTable

func (m *Event) GetTable() string

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) Reset

func (m *Event) Reset()

func (*Event) String

func (m *Event) String() string

type ListenRequest

type ListenRequest struct {
	// if provided, this string will be used to match table names to track.
	TableRegexp string `protobuf:"bytes,1,opt,name=table_regexp,json=tableRegexp" json:"table_regexp,omitempty"`
}

A request to listen to database event streams.

func (*ListenRequest) Descriptor

func (*ListenRequest) Descriptor() ([]byte, []int)

func (*ListenRequest) GetTableRegexp

func (m *ListenRequest) GetTableRegexp() string

func (*ListenRequest) ProtoMessage

func (*ListenRequest) ProtoMessage()

func (*ListenRequest) Reset

func (m *ListenRequest) Reset()

func (*ListenRequest) String

func (m *ListenRequest) String() string

type Operation

type Operation int32

An operation in the database.

const (
	Operation_UNKNOWN  Operation = 0
	Operation_INSERT   Operation = 1
	Operation_UPDATE   Operation = 2
	Operation_DELETE   Operation = 3
	Operation_TRUNCATE Operation = 4
)

func (Operation) EnumDescriptor

func (Operation) EnumDescriptor() ([]byte, []int)

func (Operation) String

func (x Operation) String() string

type PQStreamClient

type PQStreamClient interface {
	// Listen responds with a stream of database operations.
	Listen(ctx context.Context, in *ListenRequest, opts ...grpc.CallOption) (PQStream_ListenClient, error)
}

func NewPQStreamClient

func NewPQStreamClient(cc *grpc.ClientConn) PQStreamClient

type PQStreamServer

type PQStreamServer interface {
	// Listen responds with a stream of database operations.
	Listen(*ListenRequest, PQStream_ListenServer) error
}

type PQStream_ListenClient

type PQStream_ListenClient interface {
	Recv() (*Event, error)
	grpc.ClientStream
}

type PQStream_ListenServer

type PQStream_ListenServer interface {
	Send(*Event) error
	grpc.ServerStream
}

type RawEvent

type RawEvent struct {
	Schema   string                  `protobuf:"bytes,1,opt,name=schema" json:"schema,omitempty"`
	Table    string                  `protobuf:"bytes,2,opt,name=table" json:"table,omitempty"`
	Op       Operation               `protobuf:"varint,3,opt,name=op,enum=pqs.Operation" json:"op,omitempty"`
	Id       string                  `protobuf:"bytes,4,opt,name=id" json:"id,omitempty"`
	Payload  *google_protobuf.Struct `protobuf:"bytes,5,opt,name=payload" json:"payload,omitempty"`
	Previous *google_protobuf.Struct `protobuf:"bytes,6,opt,name=previous" json:"previous,omitempty"`
}

RawEvent is an internal type.

func (*RawEvent) Descriptor

func (*RawEvent) Descriptor() ([]byte, []int)

func (*RawEvent) GetId

func (m *RawEvent) GetId() string

func (*RawEvent) GetOp

func (m *RawEvent) GetOp() Operation

func (*RawEvent) GetPayload

func (m *RawEvent) GetPayload() *google_protobuf.Struct

func (*RawEvent) GetPrevious

func (m *RawEvent) GetPrevious() *google_protobuf.Struct

func (*RawEvent) GetSchema

func (m *RawEvent) GetSchema() string

func (*RawEvent) GetTable

func (m *RawEvent) GetTable() string

func (*RawEvent) ProtoMessage

func (*RawEvent) ProtoMessage()

func (*RawEvent) Reset

func (m *RawEvent) Reset()

func (*RawEvent) String

func (m *RawEvent) String() string

Jump to

Keyboard shortcuts

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