util

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AckDeltaResponse

func AckDeltaResponse(resourceType resource_v3.Type, nonce string) proto.Message

AckDeltaResponse creates a 'DeltaDiscoveryRequest' to tell the management server that the config change for the given resource type was accepted

func AckSotWResponse

func AckSotWResponse(resourceType resource_v3.Type, version, nonce string, resourceNames []string) proto.Message

AckSotWResponse creates a 'DiscoveryRequest' to tell the management server that the config change for the given resource type was accepted

func GetUnifiedMetadata

func GetUnifiedMetadata(md *envoy_config_core_v3.Metadata) (map[string]interface{}, error)

func NackDeltaResponse

func NackDeltaResponse(resourceType resource_v3.Type, nonce string, err error) proto.Message

NackDeltaResponse creates a 'DeltaDiscoveryRequest' to tell the management server that the config change for the given resource type was rejected due to the given error

func NackSotWResponse

func NackSotWResponse(resourceType resource_v3.Type, version, nonce string, resourceNames []string, err error) *discovery_v3.DiscoveryRequest

NackSotWResponse creates a 'DiscoveryRequest' to tell the management server that the config change for the given resource type was rejected due to the given error

func SortedStringSliceEqual

func SortedStringSliceEqual(a, b []string) bool

SortedStringSliceEqual returns true if the provided sorted strings are equal

func StringSliceSubtract

func StringSliceSubtract(a, b []string) []string

StringSliceSubtract returns the Get of a-b

Types

type KeyValueCollection

type KeyValueCollection[K comparable, V comparable] struct {
	// contains filtered or unexported fields
}

KeyValueCollection thread-safe collection of <K, V> items

func NewKeyValueCollection

func NewKeyValueCollection[K comparable, V comparable]() *KeyValueCollection[K, V]

func (*KeyValueCollection[K, S]) Get

func (c *KeyValueCollection[K, S]) Get(key K) (S, bool)

func (*KeyValueCollection[K, S]) Items

func (c *KeyValueCollection[K, S]) Items() map[K]S

func (*KeyValueCollection[K, S]) Keep

func (c *KeyValueCollection[K, S]) Keep(items map[K]struct{})

func (*KeyValueCollection[K, S]) Lock

func (c *KeyValueCollection[K, S]) Lock()

func (*KeyValueCollection[K, S]) RLock

func (c *KeyValueCollection[K, S]) RLock()

func (*KeyValueCollection[K, S]) RUnlock

func (c *KeyValueCollection[K, S]) RUnlock()

func (*KeyValueCollection[K, S]) Set

func (c *KeyValueCollection[K, S]) Set(key K, stats S)

func (*KeyValueCollection[K, S]) Unlock

func (c *KeyValueCollection[K, S]) Unlock()

Jump to

Keyboard shortcuts

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