Documentation ¶
Index ¶
- func CompareIPNets(a, b *net.IPNet) int
- func CompareIPNetsBytes(aPrefixLen uint8, aIP [16]byte, bPrefixLen uint8, bIP [16]byte) int
- func CompareInts(a, b int) int
- func ComparePorts(a, b uint16) int
- func ConstructLabels(key string, values []string) []*policymodel.Policy_Label
- func Difference(a []string, b []string) []string
- func GetOneHostSubnet(hostAddr string) *net.IPNet
- func GetOneHostSubnetFromIP(hostIP net.IP) *net.IPNet
- func Intersect(a []string, b []string, s ...[]string) []string
- func RemoveDuplicatePodIDs(el []podmodel.ID) []podmodel.ID
- func RemoveDuplicates(el []string) []string
- func StringPodID(pods []podmodel.ID) []string
- func StringPolicyID(policies []policymodel.ID) []string
- func UnstringNamespaceID(namespaces []string) []namespacemodel.ID
- func UnstringPodID(pods []string) []podmodel.ID
- func UnstringPolicyID(policies []string) []policymodel.ID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareIPNets ¶
CompareIPNets returns -1, 0, 1 if a<b or a==b or a>b, respectively. It hold that if *a* is subset of *b*, then a<b (and vice-versa).
func CompareIPNetsBytes ¶
CompareIPNetsBytes returns an integer comparing two IP network addresses represented as raw bytes lexicographically.
func CompareInts ¶
CompareInts is a comparison function for two integers.
func ComparePorts ¶
ComparePorts is a comparison function for two ports. Port=0 means "all-ports" and it is higher in the order than any specific port.
func ConstructLabels ¶
func ConstructLabels(key string, values []string) []*policymodel.Policy_Label
ConstructLabels returns a key-value pair as a label given an expression
func Difference ¶
Difference returns the difference of two slices
func GetOneHostSubnet ¶
GetOneHostSubnet returns the IP subnet that contains only the given host (i.e. /32 for IPv4, /128 for IPv6).
func GetOneHostSubnetFromIP ¶
GetOneHostSubnetFromIP returns the IP subnet that contains only the given host (i.e. /32 for IPv4, /128 for IPv6). Unlike GetOneHostSubnet, host address is not given as a string but rather as an instance of net.IP.
func RemoveDuplicatePodIDs ¶
RemoveDuplicatePodIDs removes duplicate pod IDs from a slice.
func RemoveDuplicates ¶
RemoveDuplicates removes duplicates entries for a slice of strings
func StringPodID ¶
StringPodID converts podmodelIDs to string podIDs
func StringPolicyID ¶
func StringPolicyID(policies []policymodel.ID) []string
StringPolicyID converts policymodelIDs to string policyIDs
func UnstringNamespaceID ¶
func UnstringNamespaceID(namespaces []string) []namespacemodel.ID
UnstringNamespaceID converts string namespaceIDs to namespacemodelIDs
func UnstringPodID ¶
UnstringPodID converts string podIDs to podmodelIDs
func UnstringPolicyID ¶
func UnstringPolicyID(policies []string) []policymodel.ID
UnstringPolicyID converts string policyIDs to policymodelIDs
Types ¶
This section is empty.