helpers

package
v0.0.0-...-f0ebf03 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(in []byte) []byte

func MeasureLatency

func MeasureLatency(ctx context.Context, ip net.IP, logger Logger) (result time.Duration)

Types

type AddrInfo

type AddrInfo = peer.AddrInfo

func CopyAddrInfo

func CopyAddrInfo(addrInfo AddrInfo) *AddrInfo

type Logger

type Logger interface {
	Error(...interface{})
	Infof(string, ...interface{})
	Debugf(string, ...interface{})
}

type ReconnectableStream

type ReconnectableStream struct {
	Stream
	// contains filtered or unexported fields
}

func NewReconnectableStream

func NewReconnectableStream(logger Logger, newFunc func() (Stream, error)) *ReconnectableStream

func (*ReconnectableStream) Connect

func (stream *ReconnectableStream) Connect()

type Stream

type Stream = network.Stream

Jump to

Keyboard shortcuts

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