This section is empty.


This section is empty.


This section is empty.


type PortCache

type PortCache struct {
	// contains filtered or unexported fields

    PortCache is a generic cache of port pairs or exact ports. It can store and do lookups of ports on exact matches or ranges. It returns the stored values

    func NewPortCache

    func NewPortCache(name string) *PortCache

      NewPortCache creates a new port cache

      func (*PortCache) AddPortSpec

      func (p *PortCache) AddPortSpec(s *portspec.PortSpec)

        AddPortSpec adds a port spec into the cache

        func (*PortCache) AddUnique

        func (p *PortCache) AddUnique(s *portspec.PortSpec) error

          AddUnique adds a port spec into the cache and makes sure its unique

          func (*PortCache) GetAllSpecValueFromPort

          func (p *PortCache) GetAllSpecValueFromPort(port uint16) ([]interface{}, error)

            GetAllSpecValueFromPort will return all the specs that potentially match. This will allow for overlapping ranges

            func (*PortCache) GetSpecValueFromPort

            func (p *PortCache) GetSpecValueFromPort(port uint16) (interface{}, error)

              GetSpecValueFromPort searches the cache for a match based on a port It will return the first match found on exact ports or on the ranges of ports. If there are multiple intervals that match it will randomly return one of them.

              func (*PortCache) Remove

              func (p *PortCache) Remove(s *portspec.PortSpec) error

                Remove will remove a port from the cache

                func (*PortCache) RemoveStringPorts

                func (p *PortCache) RemoveStringPorts(ports string) error

                  RemoveStringPorts will remove a port from the cache

                  Source Files