Documentation
¶
Overview ¶
Copyright (c) Microsoft Corporation. Licensed under the MIT License.
Copyright (c) Microsoft Corporation. Licensed under the MIT License.
Index ¶
Constants ¶
View Source
const (
MaxRecordAge = 30 * time.Minute
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentNotFoundError ¶
type ContentNotFoundError struct {
// contains filtered or unexported fields
}
ContentNotFoundError indicates that the content for the given key was not found in the network.
type Router ¶
type Router interface {
// Net returns the network interface.
Net() peernet.Network
// Resolve resolves the given key to a peer address.
Resolve(ctx context.Context, key string, allowSelf bool, count int) (<-chan PeerInfo, error)
// ResolveWithNegativeCacheCallback is like Resolve but it also returns a function callback that can be used to cache that a key could not be resolved.
ResolveWithNegativeCacheCallback(ctx context.Context, key string, allowSelf bool, count int) (<-chan PeerInfo, func(), error)
// Provide provides the given keys to the network.
// This lets the k-closest peers to the key know that we are providing it.
Provide(ctx context.Context, keys []string) error
// Close closes the router.
Close() error
}
Router provides a content routing interface to the network.
Click to show internal directories.
Click to hide internal directories.