routing

package
v0.29.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0, MIT, Apache-2.0, + 1 more Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructHTTPRouter added in v0.18.0

func ConstructHTTPRouter(endpoint string, peerID string, addrs []string, privKey string) (routing.Routing, error)

func NewParamNeededErr added in v0.14.0

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

func Parse added in v0.16.0

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

Types

type Composer added in v0.16.0

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

func (*Composer) Bootstrap added in v0.16.0

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

func (*Composer) FindPeer added in v0.16.0

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

func (*Composer) FindProvidersAsync added in v0.16.0

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

func (*Composer) GetValue added in v0.16.0

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

func (*Composer) Provide added in v0.16.0

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

func (*Composer) ProvideMany added in v0.16.0

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

func (*Composer) PutValue added in v0.16.0

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

func (*Composer) Ready added in v0.16.0

func (c *Composer) Ready() bool

func (*Composer) SearchValue added in v0.16.0

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

type ExtraDHTParams added in v0.16.0

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

type ExtraHTTPParams added in v0.18.0

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

type ParamNeededError added in v0.14.0

type ParamNeededError struct {
	ParamName  string
	RouterType config.RouterType
}

func (*ParamNeededError) Error added in v0.14.0

func (e *ParamNeededError) Error() string

type ProvideManyRouter added in v0.16.0

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