Documentation ¶
Index ¶
- func NewMockRouter(local *peer.Peer, dstore ds.Datastore) routing.IpfsRouting
- type MockRouter
- func (mr *MockRouter) FindPeer(ctx context.Context, pid peer.ID) (*peer.Peer, error)
- func (mr *MockRouter) FindProviders(ctx context.Context, key u.Key) ([]*peer.Peer, error)
- func (mr *MockRouter) FindProvidersAsync(ctx context.Context, k u.Key, max int) <-chan *peer.Peer
- func (mr *MockRouter) GetValue(ctx context.Context, key u.Key) ([]byte, error)
- func (mr *MockRouter) Provide(_ context.Context, key u.Key) error
- func (mr *MockRouter) PutValue(ctx context.Context, key u.Key, val []byte) error
- func (mr *MockRouter) SetRoutingServer(rs RoutingServer)
- type RoutingServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockRouter ¶
Types ¶
type MockRouter ¶
type MockRouter struct {
// contains filtered or unexported fields
}
func (*MockRouter) FindProviders ¶
func (*MockRouter) FindProvidersAsync ¶
func (*MockRouter) SetRoutingServer ¶
func (mr *MockRouter) SetRoutingServer(rs RoutingServer)
type RoutingServer ¶
type RoutingServer interface { Announce(*peer.Peer, u.Key) error Providers(u.Key) []*peer.Peer Client(p *peer.Peer) routing.IpfsRouting }
func VirtualRoutingServer ¶
func VirtualRoutingServer() RoutingServer
Click to show internal directories.
Click to hide internal directories.