Documentation ¶
Index ¶
- Constants
- func NewFileTransactionLogger(filename string) (core.TransactionLogger, error)
- func NewPostgresTransactionLogger(conf PostgresDBParams) (core.TransactionLogger, error)
- func NewTransactionLogger(core string, conf TlConfig) (core.TransactionLogger, error)
- type FileTransactionLogger
- type PostgresDBParams
- type PostgresTransactionLogger
- func (l *PostgresTransactionLogger) CreateTable() error
- func (l *PostgresTransactionLogger) Err() <-chan error
- func (l *PostgresTransactionLogger) Read() (<-chan core.Event, <-chan error)
- func (l *PostgresTransactionLogger) Run()
- func (l *PostgresTransactionLogger) WriteDelete(key string)
- func (l *PostgresTransactionLogger) WritePut(key, value string)
- type TlConfig
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 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 }
Click to show internal directories.
Click to hide internal directories.