Documentation
¶
Index ¶
- type NetBackend
- func (nb *NetBackend) Connect() error
- func (nb *NetBackend) Dial(peerAddr, protocol string) (net.Conn, error)
- func (nb *NetBackend) Disconnect() error
- func (nb *NetBackend) Identity() (peer.Info, error)
- func (nb *NetBackend) IsOnline() bool
- func (nb *NetBackend) Listen(protocol string) (net.Listener, error)
- func (nb *NetBackend) Ping(addr string) (backend.Pinger, error)
- func (nb *NetBackend) PublishName(partialName string) error
- func (nb *NetBackend) ResolveName(ctx context.Context, partialName string) ([]peer.Info, error)
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 ¶
ResolveName is a fake implementation.
Click to show internal directories.
Click to hide internal directories.