mock

package
v0.0.0-...-e4696f9 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2014 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockRouter

func NewMockRouter(local peer.Peer, dstore ds.Datastore) routing.IpfsRouting

Types

type MockRouter

type MockRouter struct {
	// contains filtered or unexported fields
}

func (*MockRouter) FindPeer

func (mr *MockRouter) FindPeer(ctx context.Context, pid peer.ID) (peer.Peer, error)

func (*MockRouter) FindProviders

func (mr *MockRouter) FindProviders(ctx context.Context, key u.Key) ([]peer.Peer, error)

func (*MockRouter) FindProvidersAsync

func (mr *MockRouter) FindProvidersAsync(ctx context.Context, k u.Key, max int) <-chan peer.Peer

func (*MockRouter) GetValue

func (mr *MockRouter) GetValue(ctx context.Context, key u.Key) ([]byte, error)

func (*MockRouter) Provide

func (mr *MockRouter) Provide(_ context.Context, key u.Key) error

func (*MockRouter) PutValue

func (mr *MockRouter) PutValue(ctx context.Context, key u.Key, val []byte) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳