bundle

package
v0.2.130 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundler

type Bundler struct {
	*task.Task

	// Ids of successfully bundled interactions
	Output chan *Confirmation
	// contains filtered or unexported fields
}

func NewBundler

func NewBundler(config *config.Config, db *gorm.DB) (self *Bundler)

Receives bundle items from the input channel and sends them to bundlr

func (*Bundler) WithInputChannel

func (self *Bundler) WithInputChannel(in chan *model.BundleItem) *Bundler

func (*Bundler) WithIrysClient added in v0.2.127

func (self *Bundler) WithIrysClient(client *bundlr.Client) *Bundler

func (*Bundler) WithMonitor

func (self *Bundler) WithMonitor(monitor monitoring.Monitor) *Bundler

func (*Bundler) WithTurboClient added in v0.2.127

func (self *Bundler) WithTurboClient(client *turbo.Client) *Bundler

type Collector

type Collector struct {
	*task.Task

	// Data about the interactions that need to be bundled
	Output chan *model.BundleItem
	// contains filtered or unexported fields
}

Gets the unbundled interactions and puts them on the output channel

func NewCollector

func NewCollector(config *config.Config, db *gorm.DB) (self *Collector)

Sets up the task of fetching interactions to be bundled Collects it from two sources: 1. Live source of interactions that need to be bundled 2. Interactions that somehow wasn't sent through the notification channel. Probably because of a restart.

func (*Collector) WithMonitor

func (self *Collector) WithMonitor(monitor monitoring.Monitor) *Collector

type Confirmation

type Confirmation struct {
	InteractionID int
	BundlerTxID   string
	Response      pgtype.JSONB
}

type Confirmer

type Confirmer struct {
	*task.SinkTask[*Confirmation]
	// contains filtered or unexported fields
}

Periodically saves the confirmation state of the bundlet interactions This is done to prevent flooding database with bundle_items state updates

func NewConfirmer

func NewConfirmer(config *config.Config) (self *Confirmer)

func (*Confirmer) WithDB

func (self *Confirmer) WithDB(db *gorm.DB) *Confirmer

func (*Confirmer) WithInputChannel

func (self *Confirmer) WithInputChannel(input chan *Confirmation) *Confirmer

func (*Confirmer) WithMonitor

func (self *Confirmer) WithMonitor(monitor monitoring.Monitor) *Confirmer

func (*Confirmer) WithNetworkMonitor

func (self *Confirmer) WithNetworkMonitor(v *listener.NetworkMonitor) *Confirmer

type Controller

type Controller struct {
	*task.Task
}

func NewController

func NewController(config *config.Config) (self *Controller, err error)

+---------------+ | Collector | | | | | | +-----------+ | | | Poller | | +----------+ +-----------+ +-----------------+ | +-----------+ | tx | | pd | | network_info | | | +------------>| Bundler +-------->| Confirmer |<-------------- | Network Monitor | | +-----------+ | | | | | | | | | Notifier | | +----------+ +-----------+ +-----------------+ | +-----------+ | | | +---------------+ Main class that orchestrates main syncer functionalities

type Notifier

type Notifier struct {
	*task.Task
	// contains filtered or unexported fields
}

Gets a live stream of unbundled intearctions, parses them and puts them on the output channel

func NewNotifier

func NewNotifier(config *config.Config) (self *Notifier)

func (*Notifier) WithDB

func (self *Notifier) WithDB(db *gorm.DB) *Notifier

func (*Notifier) WithMonitor

func (self *Notifier) WithMonitor(monitor monitoring.Monitor) *Notifier

func (*Notifier) WithOutputChannel

func (self *Notifier) WithOutputChannel(bundleItems chan *model.BundleItem) *Notifier

type Poller

type Poller struct {
	*task.Task
	// contains filtered or unexported fields
}

Periodically gets the unbundled interactions and puts them on the output channel Gets interactions that somehow didn't get sent through the notification channel. Probably because of a restart.

func NewPoller

func NewPoller(config *config.Config) (self *Poller)

func (*Poller) WithDB

func (self *Poller) WithDB(db *gorm.DB) *Poller

func (*Poller) WithMonitor

func (self *Poller) WithMonitor(monitor monitoring.Monitor) *Poller

func (*Poller) WithOutputChannel

func (self *Poller) WithOutputChannel(bundleItems chan *model.BundleItem) *Poller

Jump to

Keyboard shortcuts

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