gaia: go.aporeto.io/gaia/portutils Index | Files

package portutils

import "go.aporeto.io/gaia/portutils"

Index

Package Files

interfaces.go portuils.go

func ConvertToSinglePort Uses

func ConvertToSinglePort(port string) (int64, error)

ConvertToSinglePort converts a string to port.

func ExtractPortsAndProtocol Uses

func ExtractPortsAndProtocol(service string) (string, string, error)

ExtractPortsAndProtocol extracts ports and protocol from the service NOTE: The protocol should be in uppercase to match our list of protocols here https://github.com/aporeto-inc/gaia/blob/master/protocols/protocols.go

type PortsList Uses

type PortsList []int64

PortsList holds a list of ports

func ConvertToPortsList Uses

func ConvertToPortsList(ports string) (*PortsList, error)

ConvertToPortsList convert a , separated string to a list of port.

func (*PortsList) HasOverlapWithPort Uses

func (p *PortsList) HasOverlapWithPort(port int64) bool

HasOverlapWithPort returns true if the list has one overlap with the given port.

func (*PortsList) HasOverlapWithPortsList Uses

func (p *PortsList) HasOverlapWithPortsList(ports *PortsList) bool

HasOverlapWithPortsList returns true if the list has one overlap with the given ports.

func (*PortsList) HasOverlapWithPortsRanges Uses

func (p *PortsList) HasOverlapWithPortsRanges(portRanges *PortsRangeList) bool

HasOverlapWithPortsRanges returns true if the list has one overlap with the given ranges.

type PortsRange Uses

type PortsRange struct {
    FromPort int64
    ToPort   int64
}

PortsRange holds a range of ports.

func ConvertToPortsRange Uses

func ConvertToPortsRange(ports string) (*PortsRange, error)

ConvertToPortsRange converts a :-separated string to a min and max port.

func ExtractPortsAndProtocolFromHostService Uses

func ExtractPortsAndProtocolFromHostService(service string) (*PortsRange, string, error)

ExtractPortsAndProtocolFromHostService extracts the port range and the protocol from a host service like tcp/80:100. If the prefix is neither tcp or udp it will return an error. NOTE: The protocol should be in uppercase to match our list of protocols here https://github.com/aporeto-inc/gaia/blob/master/protocols/protocols.go

func (*PortsRange) HasOverlapWithPort Uses

func (p *PortsRange) HasOverlapWithPort(port int64) bool

HasOverlapWithPort returns true if the range overlaps the given port.

func (*PortsRange) HasOverlapWithPortsList Uses

func (p *PortsRange) HasOverlapWithPortsList(ports *PortsList) bool

HasOverlapWithPortsList returns true if the range overlaps one of the given ports.

func (*PortsRange) HasOverlapWithPortsRange Uses

func (p *PortsRange) HasOverlapWithPortsRange(otherRange *PortsRange) bool

HasOverlapWithPortsRange returns true if the range overlaps one of the port ranges.

func (*PortsRange) HasOverlapWithPortsRanges Uses

func (p *PortsRange) HasOverlapWithPortsRanges(otherRanges *PortsRangeList) bool

HasOverlapWithPortsRanges returns true if the range has overlaps with the given ports.

type PortsRangeList Uses

type PortsRangeList []*PortsRange

PortsRangeList holds a list of port range.

Package portutils imports 4 packages (graph) and is imported by 1 packages. Updated 2019-06-23. Refresh now. Tools for package owners.