ping

package
v0.0.0-...-f2fe5c7 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2017 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Timeout = time.Second * 20
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	List []*Ping
}

func NewCollection

func NewCollection() *Collection

func (*Collection) Add

func (c *Collection) Add(p *Ping) error

func (*Collection) AddNew

func (c *Collection) AddNew(publicKey *[crypto.PublicKeySize]byte) (*Ping, error)

func (*Collection) Clear

func (c *Collection) Clear(expiredOnly bool)

func (*Collection) Find

func (c *Collection) Find(publicKey *[crypto.PublicKeySize]byte, pingID uint64, remove bool) *Ping

Find tries to find the given ping ID and public key in the list of pings. If 'remove' is set to true, the entry will also be removed from the list.

type Ping

type Ping struct {
	PublicKey *[crypto.PublicKeySize]byte
	ID        uint64
	Time      time.Time
}

func NewPing

func NewPing(publicKey *[crypto.PublicKeySize]byte) (*Ping, error)

func (*Ping) Expired

func (p *Ping) Expired() bool

Jump to

Keyboard shortcuts

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