feed

package
v0.0.0-...-4427c07 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: AGPL-3.0 Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCursorNotReady = errors.New("subscription boundary is unavailable")

Functions

func Handler

func Handler(s consumerStore, consumers map[string]string, transactions http.Handler, configured func(string) bool) (http.Handler, error)

Types

type Client

type Client struct{ URL, Token string }

func (Client) Ack

func (c Client) Ack(ctx context.Context, _ string, id int64) error

func (Client) Height

func (c Client) Height(ctx context.Context, network string) (int64, error)

func (Client) PendingNetwork

func (c Client) PendingNetwork(ctx context.Context, _ string, network string, wait time.Duration) (*Delivery, error)

func (Client) Reconcile

func (c Client) Reconcile(ctx context.Context, consumer string, w []Watch) (Reconciliation, error)

Reconcile falls back to atomic replacement on older standalone scanners.

func (Client) Subscribe

func (c Client) Subscribe(ctx context.Context, _ string, w []Watch) (SubscriptionReceipt, error)

type Delivery

type Delivery struct {
	ID       int64           `json:"id"`
	Activity chains.Activity `json:"activity"`
}

type Feed

type Feed interface {
	Height(context.Context, string) (int64, error)
	Subscribe(context.Context, string, []Watch) (SubscriptionReceipt, error)
	PendingNetwork(context.Context, string, string, time.Duration) (*Delivery, error)
	Ack(context.Context, string, int64) error
}

Feed can be backed by a local Store or by a remote authenticated Client.

type Reconciler

type Reconciler interface {
	Reconcile(context.Context, string, []Watch) (Reconciliation, error)
}

Reconciler applies a complete desired set independently on each network.

type Reconciliation

type Reconciliation struct {
	Registrations []Registration `json:"registrations"`
	RetryNetworks []string       `json:"retry_networks"`
}

Reconciliation contains verified registrations on successful networks. RetryNetworks retain their previous state and need another reconciliation.

type Registration

type Registration struct {
	Watch
	FromHeight int64 `json:"from_height"`
}

type SubscriptionReceipt

type SubscriptionReceipt struct {
	Registrations []Registration `json:"registrations"`
	Terminations  []Termination  `json:"terminations"`
}

type Termination

type Termination struct {
	Registration
	ToHeight  int64 `json:"to_height"`
	Completed bool  `json:"completed"`
}

Both endpoints are inclusive. A termination fixes coverage immediately; pending confirmed reads can still enqueue deliveries through ToHeight.

type Watch

type Watch struct {
	Network string `json:"network"`
	Address string `json:"address"`
}

Jump to

Keyboard shortcuts

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