Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MoreSpecific ¶
MoreSpecific returns true if hostname a is more specific than b.
Types ¶
type Name ¶
type Name string
Name describes a (possibly wildcarded) hostname
func (Name) IsWildCarded ¶
func (Name) Matches ¶
Matches returns true if this hostname overlaps with the other hostname. Names overlap if: - they're fully resolved (i.e. not wildcarded) and match exactly (i.e. an exact string match) - one or both are wildcarded (e.g. "*.foo.com"), in which case we use wildcard resolution rules to determine if n is covered by o or o is covered by n. e.g.:
Name("foo.com").Matches("foo.com") = true Name("foo.com").Matches("bar.com") = false Name("*.com").Matches("foo.com") = true Name("bar.com").Matches("*.com") = true Name("*.foo.com").Matches("foo.com") = false Name("*").Matches("foo.com") = true Name("*").Matches("*.com") = true
type Names ¶
type Names []Name
Names is a collection of Name; it exists so it's easy to sort hostnames consistently across Istio. In a few locations we care about the order hostnames appear in Envoy config: primarily HTTP routes, but also in gateways, and for SNI. In those locations, we sort hostnames longest to shortest with wildcards last.
func NamesForNamespace ¶
NamesForNamespace returns the subset of hosts that are in the specified namespace. The list of hosts contains host names optionally qualified with namespace/ or */. If not qualified or qualified with *, the host name is considered to be in every namespace. e.g.: NamesForNamespace(["ns1/foo.com","ns2/bar.com"], "ns1") = Names(["foo.com"]) NamesForNamespace(["ns1/foo.com","ns2/bar.com"], "ns3") = Names([]) NamesForNamespace(["ns1/foo.com","*/bar.com"], "ns1") = Names(["foo.com","bar.com"]) NamesForNamespace(["ns1/foo.com","*/bar.com"], "ns3") = Names(["bar.com"]) NamesForNamespace(["foo.com","ns2/bar.com"], "ns2") = Names(["foo.com","bar.com"]) NamesForNamespace(["foo.com","ns2/bar.com"], "ns3") = Names(["foo.com"])
func (Names) Intersection ¶
Intersection returns the subset of host names that are covered by both h and other. e.g.:
Names(["foo.com","bar.com"]).Intersection(Names(["*.com"])) = Names(["foo.com","bar.com"]) Names(["foo.com","*.net"]).Intersection(Names(["*.com","bar.net"])) = Names(["foo.com","bar.net"]) Names(["foo.com","*.net"]).Intersection(Names(["*.bar.net"])) = Names(["*.bar.net"]) Names(["foo.com"]).Intersection(Names(["bar.com"])) = Names([]) Names([]).Intersection(Names(["bar.com"]) = Names([])