eventsource

package
v0.0.0-...-ada256f Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventSource

type EventSource struct {
	*instr.Instrumentation
	// contains filtered or unexported fields
}

EventSource generates events on a Bus after Put operations by proxying a Batching datastore.

func New

func New(b event.Bus, ds datastore.Batching) (EventSource, error)

New sets up a new EventSource or returns an error.

func (*EventSource) Batching

func (s *EventSource) Batching() datastore.Batching

Batching returns the proxied Batching datastore.

func (*EventSource) Subscribe

func (s *EventSource) Subscribe(ctx context.Context, h handleFunc) error

Subscribe handleFunc to EvtProviderPut events.

type EvtProviderPut

type EvtProviderPut struct {
	CID         cid.Cid
	PeerID      peer.ID
	SpanContext trace.SpanContext // SpanContext allows a Resource' processing to be traceable across the program
}

EvtProviderPut should be emitted on every datastore Put() for a peer providing a CID.

Jump to

Keyboard shortcuts

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