endpointmap

package
v0.0.0-...-d9fbfd9 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyExists = errors.New("already exists")

ErrAlreadyExists is returned if you attempt to add an endpoint to the map that already exists.

View Source
var ErrDoesNotExist = errors.New("does not exist")

ErrDoesNotExist is returned if you try to get an endpoint that does not exist

Functions

This section is empty.

Types

type Map

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

Map holds an endpoint map mapping endpoints to sequence maps

func New

func New(proto int) *Map

New creates a new endpoint map

func (*Map) Add

func (m *Map) Add(ip net.IP, id ping.ID, h func(*ping.Ping, error)) (sm *seqmap.Map, l int, err error)

Add returns the length of the map after modification

func (*Map) Get

func (m *Map) Get(ip net.IP, id ping.ID) (sm *seqmap.Map, ok bool, length int)

Get gets a sequence map

func (*Map) Pop

func (m *Map) Pop(ip net.IP, id ping.ID) (sm *seqmap.Map, l int, err error)

Pop removes and returns a sequence map

Jump to

Keyboard shortcuts

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