Documentation
¶
Index ¶
- Variables
- func ConstructHTTPRouter(endpoint string, peerID string, addrFunc func() []ma.Multiaddr, privKey string, ...) (routing.Routing, error)
- func DHTValueDatastore(base datastore.Datastore) datastore.Batching
- func NewParamNeededErr(param string, routing config.RouterType) error
- func Parse(routers config.Routers, methods config.Methods, extraDHT *ExtraDHTParams, ...) (routing.Routing, error)
- type Composer
- func (c *Composer) Bootstrap(ctx context.Context) error
- func (c *Composer) FindPeer(ctx context.Context, pid peer.ID) (peer.AddrInfo, error)
- func (c *Composer) FindProvidersAsync(ctx context.Context, cid cid.Cid, count int) <-chan peer.AddrInfo
- func (c *Composer) GetValue(ctx context.Context, key string, opts ...routing.Option) ([]byte, error)
- func (c *Composer) Provide(ctx context.Context, cid cid.Cid, provide bool) error
- func (c *Composer) ProvideMany(ctx context.Context, keys []multihash.Multihash) error
- func (c *Composer) PutValue(ctx context.Context, key string, val []byte, opts ...routing.Option) error
- func (c *Composer) Ready() bool
- func (c *Composer) SearchValue(ctx context.Context, key string, opts ...routing.Option) (<-chan []byte, error)
- type ExtraDHTParams
- type ExtraHTTPParams
- type ParamNeededError
- type ProvideManyRouter
Constants ¶
This section is empty.
Variables ¶
var DHTDatastoreKey = datastore.NewKey("/dht")
DHTDatastoreKey is the repo datastore namespace holding DHT value records ("/dht/pk/...", "/dht/ipns/..."). Keeping them out of the repo root separates DHT-cached third-party records from data owned by other subsystems (namesys publishes own IPNS records under "/ipns/...") and lets future layout migrations scope their scans to this prefix. Provider records are not wrapped: the DHT's provider store hard-codes its own dedicated "/providers/..." prefix, and keeping that path stable preserves stored records across upgrades.
Functions ¶
func ConstructHTTPRouter ¶ added in v0.18.0
func DHTValueDatastore ¶
DHTValueDatastore returns the namespaced view of base under which the DHT stores value records. The offline router uses the same view so that records published online resolve offline and vice versa.
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)
Parse creates a composed router from the custom routing configuration.
EXPERIMENTAL: Custom routing (Routing.Type=custom with Routing.Routers and Routing.Methods) is for research and testing only, not production use. The configuration format and behavior may change without notice between releases. HTTP-only configurations cannot reliably provide content. See docs/delegated-routing.md for limitations.
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) FindProvidersAsync ¶ added in v0.16.0
func (*Composer) ProvideMany ¶ added in v0.16.0
type ExtraDHTParams ¶ added in v0.16.0
type ExtraHTTPParams ¶ added in v0.18.0
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
}