hasher

package
v1.0.0-rc.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EndpointToString

func EndpointToString(e common.Endpoint) string

EndpointToString returns string representation of the common.Endpoint.

func HashListOfStrings

func HashListOfStrings(hashes []string) string

HashListOfStrings generates sha1 hash from a list of strings.

func HashRomanaPolicies

func HashRomanaPolicies(policies []common.Policy) string

HashRomanaPolicies generates unique hash for a list of romana policies.

func HashRomanaPolicy

func HashRomanaPolicy(policy common.Policy) string

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

func PolicyToCanonical(unsorted common.Policy) common.Policy

PolicyToCanonical sorts romana policy Ingress and AppliedTo fields.

func RuleToCanonical

func RuleToCanonical(unsorted common.Rule) common.Rule

RuleToCanonical sorts common.Rule Ports and PortRanges fields.

func RuleToString

func RuleToString(rule common.Rule) string

RuleToString generates string representation of the common.Rule.

func RulesToCanonical

func RulesToCanonical(unsorted []common.Rule) []common.Rule

RulesToCanonical returns canonical version of a []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

type PortRangeSlice []common.PortRange

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)

type RuleSlice

type RuleSlice []common.Rule

RuleSlice implements sort.Interface to allow sorting of the []common.Rule.

func (RuleSlice) Len

func (p RuleSlice) Len() int

func (RuleSlice) Less

func (p RuleSlice) Less(i, j int) bool

func (RuleSlice) Swap

func (p RuleSlice) Swap(i, j int)

type UintSlice

type UintSlice []uint

UintSlice satisfies sort.Interface to allow sorting of a []uint.

func (UintSlice) Len

func (p UintSlice) Len() int

func (UintSlice) Less

func (p UintSlice) Less(i, j int) bool

func (UintSlice) Swap

func (p UintSlice) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL