Documentation
¶
Index ¶
- Constants
- Variables
- func LevelToString(level int) string
- func OnMessageProcessed(ctx context.Context, name string, walMessage *Wal2JsonMessage) error
- func ParseLevel(level string) int
- func StartSession(ctx context.Context, loggr Logger, dsn string, identifier string, ...) (string, error)
- type CDCStreamer
- type ChannelStream
- type Logger
- type Wal2JsonChange
- type Wal2JsonMessage
- type Wal2JsonOldKeys
Constants ¶
View Source
const ( DEBUG = iota INFO WARNING ERROR PANIC FATAL NEVER_LOG )
View Source
const MsgTimestampFormat = "2006-01-02 15:04:05.999999-07"
Variables ¶
Functions ¶
func LevelToString ¶
func OnMessageProcessed ¶
func OnMessageProcessed( ctx context.Context, name string, walMessage *Wal2JsonMessage, ) error
func ParseLevel ¶
Types ¶
type CDCStreamer ¶
type CDCStreamer interface {
Send(walMessage *Wal2JsonMessage)
Receive() (*Wal2JsonMessage, error)
Close() error
}
type ChannelStream ¶
type ChannelStream struct {
// contains filtered or unexported fields
}
func NewChannelStream ¶
func NewChannelStream() *ChannelStream
func (*ChannelStream) Close ¶
func (stream *ChannelStream) Close() error
func (*ChannelStream) Receive ¶
func (stream *ChannelStream) Receive() (*Wal2JsonMessage, error)
func (*ChannelStream) Send ¶
func (stream *ChannelStream) Send(walMessage *Wal2JsonMessage)
type Logger ¶
type Logger interface {
Debug(...interface{})
Info(...interface{})
Warn(...interface{})
Error(...interface{})
Fatal(...interface{})
Panic(...interface{})
SetLevel(int)
Debugf(string, ...interface{})
Infof(string, ...interface{})
Warnf(string, ...interface{})
Errorf(string, ...interface{})
Fatalf(string, ...interface{})
Panicf(string, ...interface{})
}
type Wal2JsonChange ¶
type Wal2JsonChange struct {
Kind string `json:"kind"`
Schema string `json:"schema"`
Table string `json:"table"`
ColumnNames []string `json:"columnnames"`
ColumnTypes []string `json:"columntypes"`
ColumnValues []interface{} `json:"columnvalues"`
OldKeys Wal2JsonOldKeys `json:"oldkeys"`
}
Wal2JsonChange defines children of root documents
type Wal2JsonMessage ¶
type Wal2JsonMessage struct {
Change []Wal2JsonChange `json:"change"`
Timestamp time.Time `json:"timestamp"`
NextLSN pglogrepl.LSN `json:"nextlsn"`
WALStart pglogrepl.LSN `json:"-"`
}
func (*Wal2JsonMessage) UnmarshalJSON ¶
func (w *Wal2JsonMessage) UnmarshalJSON(data []byte) error
type Wal2JsonOldKeys ¶
type Wal2JsonOldKeys struct {
KeyNames []string `json:"keynames"`
KeyTypes []string `json:"keytypes"`
KeyValues []interface{} `json:"keyvalues"`
}
Wal2JsonOldKeys defines children of OldKeys
Click to show internal directories.
Click to hide internal directories.