Documentation
¶
Index ¶
- Variables
- func Handler(s consumerStore, consumers map[string]string, transactions http.Handler, ...) (http.Handler, error)
- type Client
- func (c Client) Ack(ctx context.Context, _ string, id int64) error
- func (c Client) Height(ctx context.Context, network string) (int64, error)
- func (c Client) PendingNetwork(ctx context.Context, _ string, network string, wait time.Duration) (*Delivery, error)
- func (c Client) Reconcile(ctx context.Context, consumer string, w []Watch) (Reconciliation, error)
- func (c Client) Subscribe(ctx context.Context, _ string, w []Watch) (SubscriptionReceipt, error)
- type Delivery
- type Feed
- type Reconciler
- type Reconciliation
- type Registration
- type SubscriptionReceipt
- type Termination
- type Watch
Constants ¶
This section is empty.
Variables ¶
var ErrCursorNotReady = errors.New("subscription boundary is unavailable")
Functions ¶
Types ¶
type Client ¶
type Client struct{ URL, Token string }
func (Client) PendingNetwork ¶
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 ¶
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 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.