mock

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2018 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetBackend

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

NetBackend provides a testing backend implementation of net.Backend. It only works on a single machine by storing some data into a temporary directory.

func NewNetBackend

func NewNetBackend(path, name string, port int) *NetBackend

NewNetBackend returns a new fake NetBackend

func (*NetBackend) Connect

func (nb *NetBackend) Connect() error

Connect is a fake implementation.

func (*NetBackend) Dial

func (nb *NetBackend) Dial(peerAddr, protocol string) (net.Conn, error)

Dial is a fake implementation.

func (*NetBackend) Disconnect

func (nb *NetBackend) Disconnect() error

Disconnect is a fake implementation.

func (*NetBackend) Identity

func (nb *NetBackend) Identity() (peer.Info, error)

Identity is a fake implementation.

func (*NetBackend) IsOnline

func (nb *NetBackend) IsOnline() bool

IsOnline is a fake implementation.

func (*NetBackend) Listen

func (nb *NetBackend) Listen(protocol string) (net.Listener, error)

Listen is a fake implementation.

func (*NetBackend) Ping

func (nb *NetBackend) Ping(addr string) (backend.Pinger, error)

Ping is a fake implementation.

func (*NetBackend) PublishName

func (nb *NetBackend) PublishName(partialName string) error

PublishName is a fake implementation.

func (*NetBackend) ResolveName

func (nb *NetBackend) ResolveName(ctx context.Context, partialName string) ([]peer.Info, error)

ResolveName is a fake implementation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL