app

package
v0.0.0-...-bfc7300 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogger

func SetLogger(cfg Config)

SetLogger configurates application logging

Types

type App

type App struct {
	Config    Config
	PgConn    *pgconn.PgConn
	ReplConn  *pgconn.PgConn
	Es        *es7.Client
	Processor []*pg.FnProcessData
}

App struct

func Get

func Get() *App

Get application

func (*App) ApplyChanges

func (app *App) ApplyChanges(blob *pg.WALBlob)

ApplyChanges takes WAL changes as a blob and processes each of those

func (*App) GetCurrentState

func (app *App) GetCurrentState() Runtime

GetCurrentState retrieves saved state from Elasticsearch

func (*App) GetEsClient

func (app *App) GetEsClient() *es7.Client

GetEsClient returns Elasticsearch client

func (*App) GetIndexName

func (app *App) GetIndexName(table, datetime string) string

GetIndexName ...

func (*App) GetPgConn

func (app *App) GetPgConn() *pgconn.PgConn

GetPgConn get datatabase connection for transactions

func (*App) GetReplConn

func (app *App) GetReplConn() *pgconn.PgConn

GetReplConn get datatabase connection for replication

func (*App) GetSlotName

func (app *App) GetSlotName() string

GetSlotName ...

func (*App) IndexSnapshotData

func (app *App) IndexSnapshotData(snapshotName string)

IndexSnapshotData ...

func (*App) Init

func (app *App) Init()

Init application

func (*App) Remove

func (app *App) Remove()

Remove created publication and replication slots

func (*App) Run

func (app *App) Run()

Run start streaming changes to elasticsearch

func (*App) UpdateCurrentState

func (app *App) UpdateCurrentState(runtime Runtime)

UpdateCurrentState ...

type Config

type Config struct {
	IndexName           string
	IndexFormat         bool
	IndexSeparator      string
	IndexDateFormat     string
	IndexFor            []string
	IndexWith           []string
	IndexColumn         string
	IndexSource         string
	IndexTarget         string
	IndexTargetURL      string
	IndexTargetCloudID  string
	IndexTargetUsername string
	IndexTargetPassword string
	LogFormat           string
	LogOutput           string
	LogLevel            string
	MetricEnabled       bool
	MetricPort          int
}

Config struct

func GetConfig

func GetConfig() Config

GetConfig get application configuration in order: env, config, cli, defaults

type Runtime

type Runtime struct {
	SlotName        string `json:"slotName"`
	ConsistentPoint string `json:"consistentPoint"`
	SnapshotName    string `json:"snapshotName,omitempty"`
}

Runtime holds the runtime information

Jump to

Keyboard shortcuts

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