Documentation ¶
Index ¶
- func EndpointToString(e common.Endpoint) string
- func HashListOfStrings(hashes []string) string
- func HashRomanaPolicies(policies []common.Policy) string
- func HashRomanaPolicy(policy common.Policy) string
- func IngressToCanonical(unsorted common.RomanaIngress) common.RomanaIngress
- func PolicyToCanonical(unsorted common.Policy) common.Policy
- func RuleToCanonical(unsorted common.Rule) common.Rule
- func RuleToString(rule common.Rule) string
- func RulesToCanonical(unsorted []common.Rule) []common.Rule
- type EndpointList
- type EndpointSortGroup
- type PortRangeSlice
- type RuleSlice
- type UintSlice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EndpointToString ¶
EndpointToString returns string representation of the common.Endpoint.
func HashListOfStrings ¶
HashListOfStrings generates sha1 hash from a list of strings.
func HashRomanaPolicies ¶
HashRomanaPolicies generates unique hash for a list of romana policies.
func HashRomanaPolicy ¶
HashRomanaPolicies generates sha1 hash from a canonical form of the policy.
func IngressToCanonical ¶
func IngressToCanonical(unsorted common.RomanaIngress) common.RomanaIngress
IngressToCanonical returns canonical version of common.RomanaIngress.
func PolicyToCanonical ¶
PolicyToCanonical sorts romana policy Ingress and AppliedTo fields.
func RuleToCanonical ¶
RuleToCanonical sorts common.Rule Ports and PortRanges fields.
func RuleToString ¶
RuleToString generates string representation of the common.Rule.
Types ¶
type EndpointList ¶
type EndpointList struct {
// contains filtered or unexported fields
}
EndpointList implements sort.Interface to allow sorting of []common.Endpoint.
func NewEndpointList ¶
func NewEndpointList(endpoints []common.Endpoint) EndpointList
NewEndpointList converts list of common.Endpoint into EndpointList for later sorting.
func (EndpointList) Len ¶
func (p EndpointList) Len() int
func (EndpointList) Less ¶
func (p EndpointList) Less(i, j int) bool
Less compares endpoints using their string representations, implements sort.Interface.
func (EndpointList) List ¶
func (p EndpointList) List() []common.Endpoint
List converts EndpointList into []common.Endpoint.
func (EndpointList) Sort ¶
func (p EndpointList) Sort() EndpointList
Sort is a convinience method to sort EndpointList, returns EndpointList to allow method chaining.
func (EndpointList) Swap ¶
func (p EndpointList) Swap(i, j int)
type EndpointSortGroup ¶
type EndpointSortGroup struct {
// contains filtered or unexported fields
}
EndpointSortGroup is an auxillary structure for the EndpointList, it contains original endpoint and precalculated string representation which will be used as a sorting criteria by EndpointList.Sort().
type PortRangeSlice ¶
PortRangeSlice implements sort.Interface to allow sorting of the []common.PortRange.
func (PortRangeSlice) Len ¶
func (p PortRangeSlice) Len() int
func (PortRangeSlice) Less ¶
func (p PortRangeSlice) Less(i, j int) bool
Less compares port ranges based on difference between low and high port number.
func (PortRangeSlice) Swap ¶
func (p PortRangeSlice) Swap(i, j int)