routing

package
v0.0.0-...-9fdd194 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewParamNeededErr

func NewParamNeededErr(param string, routing config.RouterType) error

func Parse

func Parse(routers config.Routers, methods config.Methods, extraDHT *ExtraDHTParams, extraReframe *ExtraReframeParams) (routing.Routing, error)

Types

type Composer

type Composer struct {
	GetValueRouter      routing.Routing
	PutValueRouter      routing.Routing
	FindPeersRouter     routing.Routing
	FindProvidersRouter routing.Routing
	ProvideRouter       routing.Routing
}

func (*Composer) Bootstrap

func (c *Composer) Bootstrap(ctx context.Context) error

func (*Composer) FindPeer

func (c *Composer) FindPeer(ctx context.Context, pid peer.ID) (peer.AddrInfo, error)

func (*Composer) FindProvidersAsync

func (c *Composer) FindProvidersAsync(ctx context.Context, cid cid.Cid, count int) <-chan peer.AddrInfo

func (*Composer) GetValue

func (c *Composer) GetValue(ctx context.Context, key string, opts ...routing.Option) ([]byte, error)

func (*Composer) Provide

func (c *Composer) Provide(ctx context.Context, cid cid.Cid, provide bool) error

func (*Composer) ProvideMany

func (c *Composer) ProvideMany(ctx context.Context, keys []multihash.Multihash) error

func (*Composer) PutValue

func (c *Composer) PutValue(ctx context.Context, key string, val []byte, opts ...routing.Option) error

func (*Composer) Ready

func (c *Composer) Ready() bool

func (*Composer) SearchValue

func (c *Composer) SearchValue(ctx context.Context, key string, opts ...routing.Option) (<-chan []byte, error)

type ExtraDHTParams

type ExtraDHTParams struct {
	BootstrapPeers []peer.AddrInfo
	Host           host.Host
	Validator      record.Validator
	Datastore      datastore.Batching
	Context        context.Context
}

type ExtraReframeParams

type ExtraReframeParams struct {
	PeerID     string
	Addrs      []string
	PrivKeyB64 string
}

type ParamNeededError

type ParamNeededError struct {
	ParamName  string
	RouterType config.RouterType
}

func (*ParamNeededError) Error

func (e *ParamNeededError) Error() string

type ProvideManyRouter

type ProvideManyRouter interface {
	routinghelpers.ProvideManyRouter
	routing.Routing
}

Jump to

Keyboard shortcuts

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