Documentation ¶
Index ¶
- func EndpointToString(e api.Endpoint) string
- func HashListOfStrings(hashes []string) string
- func HashRomanaPolicies(policies []api.Policy) string
- func HashRomanaPolicy(policy api.Policy) string
- func IngressToCanonical(unsorted api.RomanaIngress) api.RomanaIngress
- func PolicyToCanonical(unsorted api.Policy) api.Policy
- func RuleToCanonical(unsorted api.Rule) api.Rule
- func RuleToString(rule api.Rule) string
- func RulesToCanonical(unsorted []api.Rule) []api.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 api.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 api.RomanaIngress) api.RomanaIngress
IngressToCanonical returns canonical version of common.RomanaIngress.
func PolicyToCanonical ¶
PolicyToCanonical sorts romana policy Ingress and AppliedTo fields.
func RuleToCanonical ¶
RuleToCanonical sorts api.Rule Ports and PortRanges fields.
func RuleToString ¶
RuleToString generates string representation of the api.Rule.
Types ¶
type EndpointList ¶
type EndpointList struct {
// contains filtered or unexported fields
}
EndpointList implements sort.Interface to allow sorting of []api.Endpoint.
func NewEndpointList ¶
func NewEndpointList(endpoints []api.Endpoint) EndpointList
NewEndpointList converts list of api.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() []api.Endpoint
List converts EndpointList into []api.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)