handshake

package
v0.0.0-test-go-svm-build2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventHandshakeComplete

type EventHandshakeComplete struct {
	PID       peer.ID
	Direction network.Direction
}

EventHandshakeComplete is emitted after handshake is completed.

type Handshake

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

Handshake is a protocol for application specific handshake.

func New

func New(h host.Host, netid uint32, opts ...Opt) *Handshake

New instantiates handshake protocol for the host.

func (*Handshake) Request

func (h *Handshake) Request(ctx context.Context, pid peer.ID) error

Request handshake with a peer.

func (*Handshake) Stop

func (h *Handshake) Stop()

Stop closes any background workers.

type Opt

type Opt func(*Handshake)

Opt is for configuring Handshake.

func WithLog

func WithLog(logger log.Log) Opt

WithLog configures logger for handshake protocol.

Jump to

Keyboard shortcuts

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