eventlog

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoMigrate

func AutoMigrate(db *gorm.DB)

Types

type Event

type Event struct {
	gorm.Model

	ID uuid.UUID `gorm:"primaryKey"`

	Type string `json:"type"`

	Payload string `json:"payload"`

	Version float64 `json:"version"`

	Topic string `json:"topic"`

	Cid string `json:"cid"`

	Emitter string `json:"emitter"`

	NewAccounts pq.StringArray `gorm:"type:text[]"`

	Timestamp uint64 `json:"timestamp"`

	BlockNumber uint64 `json:"blockNumber"`
}

type EventLog

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

func NewEventLog

func NewEventLog(eventLogConfiguration EventLogConfiguration) (*EventLog, error)

func (*EventLog) ClearPendingEvents

func (e *EventLog) ClearPendingEvents(topic string) error

func (*EventLog) Confirm

func (e *EventLog) Confirm(id uuid.UUID, blockNumber uint64, timestamp uint64) (Event, error)

func (*EventLog) FindConfirmedEvents

func (e *EventLog) FindConfirmedEvents() ([]Event, error)

func (*EventLog) FindLastSynchronisedBlockNumber

func (e *EventLog) FindLastSynchronisedBlockNumber(topic string) (uint64, error)

func (*EventLog) FindPendingEvents

func (e *EventLog) FindPendingEvents() ([]Event, error)

func (*EventLog) Insert

func (e *EventLog) Insert(event Event) (Event, error)

func (*EventLog) ResetFromBlockAndInsert

func (e *EventLog) ResetFromBlockAndInsert(topic string, fromBlock uint64, events []Event) error

type EventLogConfiguration

type EventLogConfiguration struct {
	PostgresHost     string
	PostgresUser     string
	PostgresPassword string
	PostgresDb       string
	PostgresPort     string
}

Jump to

Keyboard shortcuts

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