utils

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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)

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