exchange

package
v0.0.0-...-de8e8a8 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT, Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownCodec = errors.New("unknown codec")

Functions

This section is empty.

Types

type Event

type Event int
const (
	StartEvent Event = iota
	ErrorEvent       // temporary failure
	ProgressEvent
	SuccessEvent
	FailureEvent
)

type EventData

type EventData struct {
	Event Event
	State State
}

type Exchange

type Exchange interface {
	// Code is the identifier for this exchange protocol
	Code() multicodec.Code

	// RequestData based on root, selector, and routing parameters
	RequestData(ctx context.Context, request ipld.Link, selector ipld.Node, routingProvider interface{}, routingPayload interface{}) <-chan EventData

	// Close completes use of this exchange
	Close()
}

type ExchangeMux

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

func DefaultMux

func DefaultMux() *ExchangeMux

func (*ExchangeMux) Add

func (*ExchangeMux) Register

func (e *ExchangeMux) Register(ex Exchange) error

func (*ExchangeMux) Subscribe

func (e *ExchangeMux) Subscribe() chan MuxEvent

type MuxEvent

type MuxEvent struct {
	Source *planning.TransportRequest
	EventData
}

type State

type State interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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