utils

package
v0.3.14 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DurationFromProto

func DurationFromProto(p *types.Duration) (time.Duration, error)

DurationFromProto converts a Duration to a time.Duration. DurationFromProto returns an error if the Duration is invalid or is too large to be represented in a time.Duration.

func DurationProto

func DurationProto(d time.Duration) *types.Duration

DurationProto converts a time.Duration to a Duration.

func GetHostForUpstream

func GetHostForUpstream(us *gloov1.Upstream) (string, error)

func GetHostsForUpstream

func GetHostsForUpstream(us *gloov1.Upstream) ([]string, error)

func GetLabelsForUpstream

func GetLabelsForUpstream(us *gloov1.Upstream) map[string]string

func GetNamespaceForUpstream

func GetNamespaceForUpstream(us *gloov1.Upstream) string

func GetPortForUpstream

func GetPortForUpstream(us *gloov1.Upstream) (uint32, error)

func HostsForUpstreams added in v0.3.11

func HostsForUpstreams(upstreams gloov1.UpstreamList) ([]string, error)

func LabelsAndPortsByHost added in v0.3.8

func LabelsAndPortsByHost(upstreams gloov1.UpstreamList) (map[string][]LabelsPortTuple, error)

func PodsForSelector

func PodsForSelector(selector *v1.PodSelector, upstreams gloov1.UpstreamList, allPods kubernetes.PodList) (kubernetes.PodList, error)

func PodsForUpstreams

func PodsForUpstreams(upstreams gloov1.UpstreamList, allPods kubernetes.PodList) kubernetes.PodList

func RuleAppliesToDestination added in v0.3.8

func RuleAppliesToDestination(destinationHost string, destinationSelector *v1.PodSelector, upstreams gloov1.UpstreamList) (bool, error)

func SubsetName

func SubsetName(labels map[string]string) string

func UpstreamsForSelector

func UpstreamsForSelector(selector *v1.PodSelector, allUpstreams gloov1.UpstreamList) (gloov1.UpstreamList, error)

func ValidateMeshGroups added in v0.3.8

func ValidateMeshGroups(meshes v1.MeshList, meshGroups v1.MeshGroupList, resourceErrs reporter.ResourceErrors)

Types

type LabelsPortTuple added in v0.3.8

type LabelsPortTuple struct {
	Labels map[string]string
	Port   uint32
}

type RuleSet added in v0.3.8

type RuleSet struct {
	Routing  v1.RoutingRuleList
	Security v1.SecurityRuleList
}

type RulesByMatcher added in v0.3.8

type RulesByMatcher struct {
	// contains filtered or unexported fields
}

we create a routing rule for each unique matcher

func NewRulesByMatcher added in v0.3.8

func NewRulesByMatcher(rules v1.RoutingRuleList) RulesByMatcher

func (RulesByMatcher) Sort added in v0.3.8

func (rbm RulesByMatcher) Sort() []v1.RoutingRuleList

type RulesByMesh added in v0.3.8

type RulesByMesh map[*v1.Mesh]RuleSet

func GroupRulesByMesh added in v0.3.8

func GroupRulesByMesh(
	routingRules v1.RoutingRuleList,
	securityRules v1.SecurityRuleList,
	meshes v1.MeshList,
	meshGroups v1.MeshGroupList,
	resourceErrs reporter.ResourceErrors) RulesByMesh

Jump to

Keyboard shortcuts

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