transact

package
v0.0.0-...-3b29eba Latest Latest
Warning

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

Go to latest
Published: May 8, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const FILENAME = "transactions.log"

Variables

This section is empty.

Functions

func NewFileTransactionLogger

func NewFileTransactionLogger(filename string) (core.TransactionLogger, error)

Constructor

func NewPostgresTransactionLogger

func NewPostgresTransactionLogger(conf PostgresDBParams) (core.TransactionLogger, error)

func NewTransactionLogger

func NewTransactionLogger(core string, conf TlConfig) (core.TransactionLogger, error)

Types

type FileTransactionLogger

type FileTransactionLogger struct {
	// contains filtered or unexported fields
}

func (*FileTransactionLogger) Err

func (l *FileTransactionLogger) Err() <-chan error

Return a channel of errors

func (*FileTransactionLogger) Read

func (l *FileTransactionLogger) Read() (<-chan core.Event, <-chan error)

func (*FileTransactionLogger) Run

func (l *FileTransactionLogger) Run()

creates a gorutine that read events from a channel and write them onto a file

func (*FileTransactionLogger) WriteDelete

func (l *FileTransactionLogger) WriteDelete(key string)

Logs the DELETE request

func (*FileTransactionLogger) WritePut

func (l *FileTransactionLogger) WritePut(key, value string)

Logs the PUT request

type PostgresDBParams

type PostgresDBParams struct {
	DbName    string
	Host      string
	User      string
	Password  string
	TableName string
}

type PostgresTransactionLogger

type PostgresTransactionLogger struct {
	// contains filtered or unexported fields
}

func (*PostgresTransactionLogger) CreateTable

func (l *PostgresTransactionLogger) CreateTable() error

create a table

func (*PostgresTransactionLogger) Err

func (l *PostgresTransactionLogger) Err() <-chan error

Return a channel of errors

func (*PostgresTransactionLogger) Read

func (l *PostgresTransactionLogger) Read() (<-chan core.Event, <-chan error)

func (*PostgresTransactionLogger) Run

func (l *PostgresTransactionLogger) Run()

Run the gorutinr for insert items into the DB

func (*PostgresTransactionLogger) WriteDelete

func (l *PostgresTransactionLogger) WriteDelete(key string)

Logs the DELETE request

func (*PostgresTransactionLogger) WritePut

func (l *PostgresTransactionLogger) WritePut(key, value string)

Logs the PUT request

type TlConfig

type TlConfig struct {
	Filename string
	DbConf   PostgresDBParams
}

Jump to

Keyboard shortcuts

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