utils

package
v1.18.21 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChildRouteCanAttachToParentRef added in v1.18.15

func ChildRouteCanAttachToParentRef(
	route *gwv1.HTTPRoute,
	parentRef types.NamespacedName,
) bool

ChildRouteCanAttachToParentRef returns a boolean indicating whether the given delegatee/child route can attach to a parent referenced by its NamespacedName.

A delegatee route can attach to a parent if either of the following conditions are true:

  • the child does not specify ParentRefs (implicit attachment)
  • the child has an HTTPRoute ParentReference that matches parentRef

func GetHostnameForUpstream

func GetHostnameForUpstream(us *v1.Upstream) string

func GetPortForUpstream

func GetPortForUpstream(us *v1.Upstream) uint32

func HashLabels

func HashLabels(labels map[string]string) uint64

func HashMetadata

func HashMetadata(newhash func() hash.Hash64, md *envoy_config_core_v3.Metadata) uint64

func HashProto

func HashProto(resource proto.Message) uint64

func HashProtoStruct

func HashProtoStruct(newhash func() hash.Hash64, pbStruct *structpb.Struct) uint64

HashProtoStruct hashes a protobuf Struct using the provided hash.Hash interface

func HashProtoWithHasher

func HashProtoWithHasher(hasher hash.Hash, resource proto.Message)

func HashUint64

func HashUint64(hasher io.Writer, value uint64)

func IsDelegatedRouteMatch added in v1.18.15

func IsDelegatedRouteMatch(
	parent gwv1.HTTPRouteMatch,
	child gwv1.HTTPRouteMatch,
) bool

IsDelegatedRouteMatch returns true if the child HTTPRouteMatch matches (is a subset) of the parent HTTPRouteMatch.

func ShouldChildRouteInheritParentMatcher added in v1.18.15

func ShouldChildRouteInheritParentMatcher(route *gwv1.HTTPRoute) bool

ShouldChildRouteInheritParentMatcher returns true if the child HTTPRoute should inherit the parent HTTPRoute's matcher

Types

type AsyncQueue

type AsyncQueue[T any] interface {
	// Dequeue will pop the first available item off of the queue.
	// This function will block until there is an item available, or the context is canceled.
	// If the context is canceled this function will return ctx.Err().
	Dequeue(ctx context.Context) (T, error)
	// Enqueue will push an item onto the queue. If no space is available on the queue,
	// this function will return immediately and drop the item.
	Enqueue(T)
	// Next will return a channel so that this can be used in a select statement.
	Next() <-chan T
}

func NewAsyncQueue

func NewAsyncQueue[T any]() AsyncQueue[T]

Jump to

Keyboard shortcuts

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