set

package
v0.4.5-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrConflict

type ErrConflict struct {
	Port uint
}

ErrConflict is return when trying to add a port in the set that is already present

func (ErrConflict) Error

func (e ErrConflict) Error() string

type UIntSet added in v0.4.9

type UIntSet struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

UIntSet is a set containing uint

func NewInt added in v0.4.9

func NewInt() *UIntSet

NewInt creates a new set for int

func (*UIntSet) Add added in v0.4.9

func (p *UIntSet) Add(i uint) error

Add tries to add port to the set. If port is already present errPortConflict is return otherwise nil is returned

func (*UIntSet) List added in v0.4.9

func (p *UIntSet) List() ([]uint, error)

List returns a list of uint present in the set

func (*UIntSet) Remove added in v0.4.9

func (p *UIntSet) Remove(i uint)

Remove removes a port from the set removes never fails cause if the port is not in the set remove is a nop-op

Jump to

Keyboard shortcuts

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