Documentation ¶
Index ¶
- Constants
- func StartSummaryChannel(ctx context.Context, serverVersion string, kc *Config) (<-chan message.TxnSummary, error)
- func StartTransactionChannel(serverVersion string, kc *Config, stopper WaitForStop) (<-chan *message.Transaction, error)
- func TransactionChannel(serverVersion string, kc *Config) (<-chan *message.Transaction, error)
- type Config
- type FullStream
- type TxnChannelStopper
- type WaitForStop
Constants ¶
const BufferDirectoryDefaultBase = "/var/tmp/keryx"
BufferDirectoryDefaultBase is the root directory to attempt to create buffers files in if nothing else is specified
Variables ¶
This section is empty.
Functions ¶
func StartSummaryChannel ¶
func StartSummaryChannel(ctx context.Context, serverVersion string, kc *Config) (<-chan message.TxnSummary, error)
StartSummaryChannel sets up a keryx symmary stream and schema reader with the provided configuration and returns a channel
func StartTransactionChannel ¶
func StartTransactionChannel(serverVersion string, kc *Config, stopper WaitForStop) (<-chan *message.Transaction, error)
StartTransactionChannel sets up a keryx stream and schema reader with the provided configuration and return it as a channel. The channel can be stopped with the provided stopper
func TransactionChannel ¶
func TransactionChannel(serverVersion string, kc *Config) (<-chan *message.Transaction, error)
TransactionChannel sets up a keryx stream and schema reader with the provided configuration and returns it as a channel
Types ¶
type Config ¶
type Config struct { DataDir string `json:"data_dir"` PGConnStrings []string `json:"pg_conn_strings"` BufferMax int `json:"buffer_max"` ExcludeRelations map[string][]string `json:"exclude,omitempty"` IncludeRelations map[string][]string `json:"include,omitempty"` BufferDirectory string `json:"buffer_directory"` MaxMessagePerTxn uint `json:"max_message_per_txn"` }
Config contains necessary information to start a keryx stream
func ConfigFromFile ¶
ConfigFromFile loads a config object from a json file
func (*Config) ExcludedTables ¶
ExcludedTables returns message.Tables from the config
func (*Config) GetBufferDirectoryOrTemp ¶
GetBufferDirectoryOrTemp gets the buffer directory out of the config file. If it isnt defined it creates it in BufferDirectoryDefaultBase
func (*Config) IncludedTables ¶
IncludedTables returns message.Tables from the config
type FullStream ¶
type FullStream struct { MaxMessageCount uint // contains filtered or unexported fields }
FullStream is a facade around the full process of taking WAL entries and publishing them as txn messages.
func NewKeryxStream ¶
func NewKeryxStream(sr *pg.SchemaReader, maxMessageCount uint) *FullStream
NewKeryxStream takes a schema reader and returns a FullStream
func (*FullStream) StartKeryxStream ¶
func (fs *FullStream) StartKeryxStream(serverVersion string, filters filters.MessageFilter, dataDir string, bufferWorkingDirectory string) (<-chan *message.Transaction, error)
StartKeryxStream will start all the streams necessary to go from WAL entries to txn messages.
func (*FullStream) Stop ¶
func (fs *FullStream) Stop()
Stop will end the reading on the WAL log and subsequent streams will therefore end.
type TxnChannelStopper ¶
type TxnChannelStopper struct {
// contains filtered or unexported fields
}
TxnChannelStopper can be used to stop a Transaction channel
func NewTxnChannelStopper ¶
func NewTxnChannelStopper() *TxnChannelStopper
NewTxnChannelStopper creates a TxnChannelStopper
func (*TxnChannelStopper) Stop ¶
func (t *TxnChannelStopper) Stop()
Stop will initiate a Transaction channel shutdown
func (*TxnChannelStopper) Wait ¶
func (t *TxnChannelStopper) Wait()
Wait will block until Stop is called {