Documentation ¶
Index ¶
- Constants
- Variables
- func DynamicMapProviderGet[Key comparable, Val any](prod DynamicMapProvider[Key, Val], key Key) Val
- func DynamicMapProviderRelease[Key comparable, Val any](prod DynamicMapProviderWithRelease[Key, Val], key Key)
- func Func11Compose11[Type1, Type2, Type3 any](fn1 func(Type1) Type2, fn2 func(Type2) Type3) func(Type1) Type3
- func GetNamespacesBuiltIntoEdgeClusters() k8ssets.String
- func GetNamespacesBuiltIntoMailboxes() k8ssets.String
- func HashSetCopy[Elt any](domain HashDomain[Elt]) func(Visitable[Elt]) MutableSet[Elt]
- func Identity1[Val any](val Val) Val
- func MGRWithVersion(gr metav1.GroupResource, version string) metav1.GroupVersionResource
- func MapAddAll[Key, Val any](theMap MutableMap[Key, Val], adds Visitable[Pair[Key, Val]])
- func MapApply[Key, Val any](theMap Map[Key, Val], receiver MappingReceiver[Key, Val])
- func MapEnumerateDifferences[Key, Val comparable](left, right Map[Key, Val], receiver MapChangeReceiver[Key, Val])
- func MapEnumerateDifferencesParametric[Key, Val any](isEqual func(Val, Val) bool, left, right Map[Key, Val], ...)
- func MapEqual[Key, Val comparable](left, right Map[Key, Val]) bool
- func MapEqualParametric[Key comparable, Val any](isEqual func(Val, Val) bool) func(map1, map2 Map[Key, Val]) bool
- func MapGetAdd[Key, Val any](theMap MutableMap[Key, Val], key Key, want bool, valGenerator func(Key) Val) Val
- func MapRemoveAll[Key, Val any](theMap MutableMap[Key, Val], goners Visitable[Pair[Key, Val]])
- func MapSetAddNoResult[Elt comparable](set MapSet[Elt], elt Elt)
- func MapSetSymmetricDifference[Elt comparable](wantLeftMinusRight, wantIntersection, wantRightMinusLeft bool, ...) (MapSet[Elt], MapSet[Elt], MapSet[Elt])
- func MapTransformToSlice[Key, Val, Transformed any](theMap Map[Key, Val], xform func(Key, Val) Transformed) []Transformed
- func MapUpdateToMatch[Key, Val comparable](current MutableMap[Key, Val], target Visitable[Pair[Key, Val]])
- func MappingReceiverAsVisitor[Key, Val any](receiver MappingReceiver[Key, Val]) func(Pair[Key, Val]) error
- func MappingReceiverNegativeAsVisitor[Key, Val any](receiver MappingReceiver[Key, Val]) func(Pair[Key, Val]) error
- func MetaGroupResourceToSchema(gr metav1.GroupResource) schema.GroupResource
- func NewDynamicFullJoin12VWith13[ColX, ColY, ColZ comparable, Val any](logger klog.Logger, receiver MappingReceiver[Triple[ColX, ColY, ColZ], Val]) (MappingReceiver[Pair[ColX, ColY], Val], SetWriter[Pair[ColX, ColZ]])
- func NewDynamicFullJoin12with13[ColX, ColY, ColZ comparable](logger klog.Logger, receiver SetWriter[Triple[ColX, ColY, ColZ]]) (SetWriter[Pair[ColX, ColY]], SetWriter[Pair[ColX, ColZ]])
- func NewDynamicFullJoin12with13Parametric[ColX, ColY, ColZ any](logger klog.Logger, hashDomainX HashDomain[ColX], hashDomainY HashDomain[ColY], ...) (SetWriter[Pair[ColX, ColY]], SetWriter[Pair[ColX, ColZ]])
- func NewDynamicJoin12with13[ColX, ColY, ColZ comparable](logger klog.Logger, receiver SetWriter[Pair[ColY, ColZ]]) (SetWriter[Pair[ColX, ColY]], SetWriter[Pair[ColX, ColZ]])
- func NewGenericIndexedSet[Tuple, Key, Val, ValMutableSet, ValSet any](factoring Factorer[Tuple, Key, Val], valSetFactory func(Key) ValMutableSet, ...) *genericMutableIndexedSet[Tuple, Key, Val, ValMutableSet, ValSet]
- func NewHashMap[Key, Val any](domain HashDomain[Key]) func(MapChangeReceiver[Key, Val]) MutableMap[Key, Val]
- func NewMapMapFactory[Key comparable, Val any](observer MapChangeReceiver[Key, Val]) func() MutableMap[Key, Val]
- func NewPair1Then2[First any, Second any](first First) func(Second) Pair[First, Second]
- func NewPair2Then1[First any, Second any](second Second) func(First) Pair[First, Second]
- func NewPlacementTranslator(numThreads int, ctx context.Context, ...) *placementTranslator
- func NewThunk[Val any](val Val) func() Val
- func NewWorkloadProjector(ctx context.Context, configConcurrency int, resourceModes ResourceModes, ...) *workloadProjector
- func ObjectIsSystem(objm metav1.Object) bool
- func ResourceSupportsInformers(metarsc *urmetav1a1.APIResource) bool
- func SPMailboxWorkspaceName(sp SinglePlacement) string
- func SetAddAll[Elt any](set MutableSet[Elt], adds Visitable[Elt]) (someNew, allNew bool)
- func SetEnumerateDifferences[Elt any](left, right Set[Elt], receiver SetWriter[Elt])
- func SetEqual[Elt any](set1, set2 Set[Elt]) bool
- func SetLessOrEqual[Elt any](set1, set2 Set[Elt]) bool
- func SetRemoveAll[Elt any](set MutableSet[Elt], goners Visitable[Elt]) (someNew, allNew bool)
- func SetUpdateToMatch[Elt comparable](current MutableSet[Elt], target Visitable[Elt], ...)
- func SliceApply[Elt any](slice []Elt, fn func(Elt))
- func SliceContains[Elt comparable](slice []Elt, seek Elt) bool
- func SliceContainsParametric[Elt any](isEqual func(Elt, Elt) bool, slice []Elt, seek Elt) bool
- func SliceCopy[Elt any](original []Elt) []Elt
- func SliceEqual[Elt comparable](a, b []Elt) bool
- func SliceRemoveFunctional[Elt comparable](slice []Elt, seek Elt) []Elt
- func ToHeap[Val any](val Val) *Val
- func UpsyncSetEqual(left, right edgeapi.UpsyncSet) bool
- func VisitableGet[Elt any](seq Visitable[Elt], index int) (Elt, bool)
- func VisitableHas[Elt comparable](set Visitable[Elt], seek Elt) bool
- func VisitableLen[Elt any](visitable Visitable[Elt]) int
- func VisitableMapFnReduceOr[Elt any](visitable Visitable[Elt], test func(Elt) bool) bool
- func VisitableToSlice[Elt any](set Visitable[Elt]) []Elt
- func VisitableTransformToSlice[Original, Transformed any](set Visitable[Original], xform func(Original) Transformed) []Transformed
- type APIGroupInfo
- type APIMapProvider
- type APIWatchMapProvider
- type BindingOrganizer
- type Client
- type ClientTracker
- type ClusterWhatWhereFullKey
- type Comparison
- type DownsyncsDifferencerConstructor
- type DynamicMapProvider
- type DynamicMapProviderWithRelease
- type DynamicValueProvider
- type Empty
- type Emptyable
- type EventHandler
- type ExternalName
- type FactoredMap
- func NewFactoredMap[WholeKey, KeyPartA, KeyPartB comparable, Val any](keyDecomposer Factorer[WholeKey, KeyPartA, KeyPartB], ...) FactoredMap[WholeKey, KeyPartA, KeyPartB, Val]
- func NewFactoredMapMap[WholeKey, KeyPartA, KeyPartB comparable, Val any](keyDecomposer Factorer[WholeKey, KeyPartA, KeyPartB], ...) FactoredMap[WholeKey, KeyPartA, KeyPartB, Val]
- func NewFactoredMapMapAggregator[WholeKey, KeyPartA, KeyPartB comparable, Val any, Aggregation any](keyDecomposer Factorer[WholeKey, KeyPartA, KeyPartB], ...) FactoredMap[WholeKey, KeyPartA, KeyPartB, Val]
- type FactoredMapIndex
- type Factorer
- func NewFactorer[Whole, PartA, PartB any](forward func(Whole) Pair[PartA, PartB], reverse func(Pair[PartA, PartB]) Whole) Factorer[Whole, PartA, PartB]
- func PairFactorer[PartA, PartB any]() Factorer[Pair[PartA, PartB], PartA, PartB]
- func QuadFactorerTo1and234[ColW, ColX, ColY, ColZ any]() Factorer[Quad[ColW, ColX, ColY, ColZ], ColW, Triple[ColX, ColY, ColZ]]
- func TripleFactorerTo13and2[ColX, ColY, ColZ any]() Factorer[Triple[ColX, ColY, ColZ], Pair[ColX, ColZ], ColY]
- func TripleFactorerTo1and23[ColX, ColY, ColZ any]() Factorer[Triple[ColX, ColY, ColZ], ColX, Pair[ColY, ColZ]]
- func TripleFactorerTo23and1[ColX, ColY, ColZ any]() Factorer[Triple[ColX, ColY, ColZ], Pair[ColY, ColZ], ColX]
- func TripleFactorerTo3and21[ColX, ColY, ColZ any]() Factorer[Triple[ColX, ColY, ColZ], ColZ, Pair[ColY, ColX]]
- type GenericIndexedSet
- type GenericMutableIndexedSet
- type GroupResourceInstance
- type HashDomain
- func NewSliceHashDomain[Elt any](eltDomain HashDomain[Elt]) HashDomain[[]Elt]
- func NewTransformHashDomain[Original, Transformed any](tranform func(Original) Transformed, transformedDomain HashDomain[Transformed]) HashDomain[Original]
- func PairHashDomain[First, Second any](first HashDomain[First], second HashDomain[Second]) HashDomain[Pair[First, Second]]
- func TripleHashDomain[First, Second, Third any](first HashDomain[First], second HashDomain[Second], third HashDomain[Third]) HashDomain[Triple[First, Second, Third]]
- type HashDomainFuncs
- type HashDomainString
- type HashSinglePlacement
- type HashUpsyncSet
- type HashValue
- type Index2
- type Map
- func Map12VEquijoinRelation13[First, Second, Third comparable, Val any](left Map[Pair[First, Second], Val], right Relation2[Second, Third]) Map[Triple[First, Second, Third], Val]
- func MapEquijoin12With13[Key comparable, ValLeft, ValRight any](left Map[Key, ValLeft], right Map[Key, ValRight]) Map[Key, Pair[ValLeft, ValRight]]
- func MapReadonly[Key, Val any](inner Map[Key, Val]) Map[Key, Val]
- func NewMapToConstant[Key comparable, Val any](keys Set[Key], val Val) Map[Key, Val]
- func RotateKeyMap[Original, Rotated comparable, Val any](rotator Rotator[Original, Rotated], inner Map[Rotated, Val]) Map[Original, Val]
- type MapChangeReceiver
- type MapChangeReceiverFork
- type MapChangeReceiverFuncs
- type MapDifferenceConstructor
- type MapMap
- func MapMapCopy[Key comparable, Val any](observer MapChangeReceiver[Key, Val], other Visitable[Pair[Key, Val]]) MapMap[Key, Val]
- func MintMapMap[Key comparable, Val any](theMap map[Key]Val, observer MapChangeReceiver[Key, Val]) MapMap[Key, Val]
- func NewMapMap[Key comparable, Val any](observer MapChangeReceiver[Key, Val]) MapMap[Key, Val]
- func (mm MapMap[Key, Val]) AddAllByVisit(what Visitable[Pair[Key, Val]]) MapMap[Key, Val]
- func (mm MapMap[Key, Val]) AddArgs(args ...Pair[Key, Val]) MapMap[Key, Val]
- func (mm MapMap[Key, Val]) Delete(key Key)
- func (mm MapMap[Key, Val]) Get(key Key) (Val, bool)
- func (mm MapMap[Key, Val]) IsEmpty() bool
- func (mm MapMap[Key, Val]) Len() int
- func (mm MapMap[Key, Val]) LenIsCheap() bool
- func (mm MapMap[Key, Val]) Put(key Key, val Val)
- func (mm MapMap[Key, Val]) Visit(visitor func(Pair[Key, Val]) error) error
- type MapSet
- type MapToConstant
- type MappingReceiver
- func MapKeySetReceiverLossy[Key, Val any](ksr SetWriter[Key]) MappingReceiver[Key, Val]
- func MappingReceiverFunc[Key, Val any](fn func() MappingReceiver[Key, Val]) MappingReceiver[Key, Val]
- func NewLoggingMappingReceiver[Key comparable, Val any](mapName string, logger klog.Logger) MappingReceiver[Key, Val]
- func NewMappingReceiverFuncs[Key, Val any](put func(Key, Val), delete func(Key)) MappingReceiver[Key, Val]
- func RotateMappingReceiver[Original, Rotated comparable, Val any](rotator Rotator[Original, Rotated], inner MappingReceiver[Rotated, Val]) MappingReceiver[Original, Val]
- type MappingReceiverFork
- type MappingReceiverFuncs
- func (mrf MappingReceiverFuncs[Key, Val]) Create(key Key, val Val)
- func (mrf MappingReceiverFuncs[Key, Val]) Delete(key Key)
- func (mrf MappingReceiverFuncs[Key, Val]) DeleteWithFinal(key Key, oldVal Val)
- func (mrf MappingReceiverFuncs[Key, Val]) Put(key Key, val Val)
- func (mrf MappingReceiverFuncs[Key, Val]) Update(key Key, oldVal, newVal Val)
- type MappingReceiverHolder
- type MappingReceiverHolderFork
- type MutableIndex2
- type MutableMap
- func MutableMapWithKeyObserver[Key, Val any](mm MutableMap[Key, Val], observer SetWriter[Key]) MutableMap[Key, Val]
- func RotatedKeyMutableMap[Original, Rotated comparable, Val any](rotator Rotator[Original, Rotated], inner MutableMap[Rotated, Val]) MutableMap[Original, Val]
- func WrapMapWithMutex[Key comparable, Val any](theMap MutableMap[Key, Val]) MutableMap[Key, Val]
- type MutableRelation2
- type MutableSet
- type NamespaceAndDestination
- type NamespaceDistributionTuple
- type NamespaceName
- type NamespacedJoinKeyLessnS
- type NamespacedResourceDistributionTuple
- type NamespacedWhatWhereFullKey
- type NatureMode
- type NonNamespacedDistributionTuple
- type ObjectNameToDestinations
- type Pair
- type ProjectionKey
- type ProjectionModeKey
- type ProjectionModeVal
- type PropagationMode
- type Quad
- type Receiver
- func NewMapDifferenceByMapAndEnum[MapType any, Key, Val comparable](visitablize func(MapType) Visitable[Pair[Key, Val]], ...) Receiver[MapType]
- func NewResolvedWhereDifferencer(eltChangeReceiver SetWriter[SinglePlacement]) Receiver[ResolvedWhere]
- func NewSetDifferenceByMapAndEnum[SetType any, Elt comparable](visitablize func(SetType) Visitable[Elt], eltChangeReceiver SetWriter[Elt]) Receiver[SetType]
- func NewSliceDifferencerParametric[Elt any](isEqual func(Elt, Elt) bool, changeReceiver SetChangeReceiver[Elt], ...) Receiver[[]Elt]
- func NewUpsyncDifferencer(eltReceiver SetChangeReceiver[edgeapi.UpsyncSet]) Receiver[[]edgeapi.UpsyncSet]
- func NewWorkloadPartsDifferencer(mappingReceiver MapChangeReceiver[WorkloadPartID, WorkloadPartDetails]) Receiver[WorkloadParts]
- type Reducer
- func MapSetCopier[Elt comparable]() Reducer[Elt, MapSet[Elt]]
- func StatefulReducer[Elt any, Accum any, Ans any](initialize func() Accum, add func(Accum, Elt), finish func(Accum) Ans) Reducer[Elt, Ans]
- func ValueReducer[Elt any, Accum any, Ans any](initialize func() Accum, add func(Accum, Elt) Accum, finish func(Accum) Ans) Reducer[Elt, Ans]
- type Relation2
- type RelayMap
- type ResolvedWhat
- type ResolvedWhere
- type ResolvedWhereDifferencerConstructor
- type ResourceDetails
- type ResourceDiscoveryKey
- type ResourceMode
- type ResourceModes
- type Rotator
- func NewRotator[Original, Rotated any](forward func(Original) Rotated, reverse func(Rotated) Original) Rotator[Original, Rotated]
- func NoRotation[Original any]() Rotator[Original, Original]
- func PairReverser[PartA, PartB any]() Rotator[Pair[PartA, PartB], Pair[PartB, PartA]]
- func TripleReverser[PartA, PartB, PartC any]() Rotator[Triple[PartA, PartB, PartC], Triple[PartC, PartB, PartA]]
- type RunAll
- type Runnable
- type Set
- func MapKeySet[Key comparable, Val any](theMap Map[Key, Val]) Set[Key]
- func NewSetReadonly[Elt any](set MutableSet[Elt]) Set[Elt]
- func SetIntersection[Elt any](set1, set2 Set[Elt]) Set[Elt]
- func SetRotate[Original, Rotated any](originalSet Set[Original], rotator Rotator[Original, Rotated]) Set[Rotated]
- type SetBinder
- type SetBinderConstructor
- type SetChangeReceiver
- type SetDifferencerConstructor
- type SetReadonly
- type SetWriter
- func NewLoggingSetWriter[Elt any](setName string, logger klog.Logger) SetWriter[Elt]
- func NewSetChangeProjector[Whole, PartA, PartB any](factoring Factorer[Whole, PartA, PartB], partAReceiver SetWriter[PartA], ...) SetWriter[Whole]
- func NewSetChangeProjectorByHashMap[Whole, PartA, PartB any](factoring Factorer[Whole, PartA, PartB], partAReceiver SetWriter[PartA], ...) SetWriter[Whole]
- func NewSetChangeProjectorByMapMap[Whole any, PartA, PartB comparable](factoring Factorer[Whole, PartA, PartB], partAReceiver SetWriter[PartA]) SetWriter[Whole]
- func NewSetWriterFuncs[Elt any](OnAdd, OnRemove func(Elt) bool) SetWriter[Elt]
- func SetWriterFork[Elt any](combineWithAnd bool, receivers ...SetWriter[Elt]) SetWriter[Elt]
- func SetWriterReverse[Elt any](forward SetWriter[Elt]) SetWriter[Elt]
- func TransformSetWriter[Type1, Type2 any](transform func(Type1) Type2, inner SetWriter[Type2]) SetWriter[Type1]
- type SetWriterFuncs
- type SingleBinder
- type SingleBindingOps
- type SingleIndexedRelation2
- func NewHashRelation2[First, Second any](hashDomainFirst HashDomain[First], hashDomainSecond HashDomain[Second], ...) SingleIndexedRelation2[First, Second]
- func NewMapRelation2[First, Second comparable](pairs ...Pair[First, Second]) SingleIndexedRelation2[First, Second]
- func NewSingleIndexedRelation2[First, Second any](secondSetFactory func(First) MutableSet[Second], ...) SingleIndexedRelation2[First, Second]
- type SingleIndexedRelation3
- type SingleIndexedRelation4
- type SinglePlacement
- type SliceHashDomain
- type SourceAndDestination
- type TestAPIMapProvider
- type TestAPIPerCluster
- type TransactionalMappingReceiver
- type TransformHashDomain
- type TransformMappingReceiver
- type TransformingRelayMap
- type Triple
- type TripleSetWriterReverse23
- type TrivialTransactor
- type UpsyncOps
- type UpsyncsDifferenceConstructor
- type Visitable
- func JoinByVisitSquared[Left, Right, Joint any](left Visitable[Left], right Visitable[Right], ...) Visitable[Joint]
- func MapSetAsVisitable[Elt comparable](ms MapSet[Elt]) Visitable[Elt]
- func ResolvedWhatAsVisitable(rw WorkloadParts) Visitable[Pair[WorkloadPartID, WorkloadPartDetails]]
- func ResolvedWhereAsVisitable(rw ResolvedWhere) Visitable[SinglePlacement]
- func TransformVisitable[Original, Transformed any](originalVisitable Visitable[Original], transform func(Original) Transformed) Visitable[Transformed]
- type VisitableStringerVal
- type WhatResolver
- type WhatResolverClusterHandler
- func (wr WhatResolverClusterHandler) Get(placement ExternalName, kont func(WorkloadParts))
- func (wrh WhatResolverClusterHandler) OnAdd(obj any)
- func (wrh WhatResolverClusterHandler) OnDelete(obj any)
- func (wrh WhatResolverClusterHandler) OnUpdate(oldObj, newObj any)
- func (wr WhatResolverClusterHandler) Run(ctx context.Context)
- type WhatResolverScopedHandler
- func (wr WhatResolverScopedHandler) Get(placement ExternalName, kont func(WorkloadParts))
- func (wrh WhatResolverScopedHandler) OnAdd(obj any)
- func (wrh WhatResolverScopedHandler) OnDelete(obj any)
- func (wrh WhatResolverScopedHandler) OnUpdate(oldObj, newObj any)
- func (wr WhatResolverScopedHandler) Run(ctx context.Context)
- type WhereResolver
- type WhereResolverClusterHandler
- func (wr WhereResolverClusterHandler) AddReceiver(receiver MappingReceiver[ExternalName, ResolvedWhere], notifyCurrent bool)
- func (wr WhereResolverClusterHandler) Get(placement ExternalName, kont func(ResolvedWhere))
- func (wrh WhereResolverClusterHandler) OnAdd(obj any)
- func (wrh WhereResolverClusterHandler) OnDelete(obj any)
- func (wrh WhereResolverClusterHandler) OnUpdate(oldObj, newObj any)
- func (wr WhereResolverClusterHandler) Run(ctx context.Context)
- type WorkloadPartDetails
- type WorkloadPartID
- type WorkloadPartX
- type WorkloadParts
- type WorkloadProjectionSections
- type WorkloadProjector
Constants ¶
const FieldManager = "placement-translator"
const ProjectedLabelKey string = "edge.kcp.io/projected"
const ProjectedLabelVal string = "yes"
const SyncerConfigName = "the-one"
const WSNameSep = "-mb-"
Variables ¶
var DefaultResourceMode = ResourceMode{ PropagationMode: GoesToEdge, NatureMode: NaturalyDenatured, BuiltinToEdge: false, }
DefaultResourceMode is the handling for every user-defined resource
var GRsForciblyDenatured = NewMapSet(
mkgr("admissionregistration.k8s.io", "mutatingwebhookconfigurations"),
mkgr("admissionregistration.k8s.io", "validatingwebhookconfigurations"),
mkgr("flowcontrol.apiserver.k8s.io", "flowschemas"),
mkgr("flowcontrol.apiserver.k8s.io", "prioritylevelconfigurations"),
mkgr("rbac.authorization.k8s.io", "clusterroles"),
mkgr("rbac.authorization.k8s.io", "clusterrolebindingss"),
mkgr("rbac.authorization.k8s.io", "roles"),
mkgr("rbac.authorization.k8s.io", "rolebindings"),
mkgr("", "limitranges"),
mkgr("", "resourcequotas"),
mkgr("", "serviceaccounts"),
)
var GRsNaturedInBoth = NewMapSet(
mkgr("apiextensions.k8s.io", "customresourcedefinitions"),
mkgr("", "namespaces"),
)
var GRsNotForEdge = NewMapSet(
mkgr("apis.kcp.io", "apiexports"),
mkgr("apis.kcp.io", "apiexportendpointslices"),
mkgr("apis.kcp.io", "apiresourceschemas"),
mkgr("apps", "controllerrevisions"),
mkgr("authentication.k8s.io", "tokenreviews"),
mkgr("authorization.k8s.io", "localsubjectaccessreviews"),
mkgr("authorization.k8s.io", "selfsubjectaccessreviews"),
mkgr("authorization.k8s.io", "selfsubjectrulesreviews"),
mkgr("authorization.k8s.io", "subjectaccessreviews"),
mkgr("certificates.k8s.io", "certificatesigningrequests"),
mkgr("core.kcp.io", "logicalclusters"),
mkgr("core.kcp.io", "shards"),
mkgr("events.k8s.io", "events"),
mkgr("", "bindings"),
mkgr("", "componentstatuses"),
mkgr("", "events"),
mkgr("", "nodes"),
)
var GRsNotSupported = NewMapSet(
mkgr("apiregistration.k8s.io", "apiservices"),
mkgr("apiresource.kcp.io", "apiresourceimports"),
mkgr("apiresource.kcp.io", "negotiatedapiresources"),
mkgr("apis.kcp.io", "apiconversions"),
)
var GroupsNotForEdge = k8ssets.NewString(
"edge.kcp.io",
"scheduling.kcp.io",
"tenancy.kcp.io",
"topology.kcp.io",
"workload.kcp.io",
)
var HashClusterString = PairHashDomain[logicalcluster.Name, string](HashLogicalClusterName, HashDomainString{})
var HashExternalName = NewTransformHashDomain(factorExternalName.First, HashClusterString)
var HashLogicalClusterName = NewTransformHashDomain[logicalcluster.Name, string](func(name logicalcluster.Name) string { return string(name) }, HashDomainString{})
var NaturedInCenterGoToMailbox = NewMapSet(
mkgr("apis.kcp.io", "apibindings"),
)
var SliceOfStringDomain = NewSliceHashDomain[string](HashDomainString{})
Functions ¶
func DynamicMapProviderGet ¶
func DynamicMapProviderGet[Key comparable, Val any](prod DynamicMapProvider[Key, Val], key Key) Val
DynamicMapProviderGet does a non-CPS Get. In situations with concurrency, regular clients (as in AddReceiver) get timing splinters if they use this.
func DynamicMapProviderRelease ¶
func DynamicMapProviderRelease[Key comparable, Val any](prod DynamicMapProviderWithRelease[Key, Val], key Key)
func Func11Compose11 ¶
func Func11Compose11[Type1, Type2, Type3 any](fn1 func(Type1) Type2, fn2 func(Type2) Type3) func(Type1) Type3
Func11Compose11 composes two 1-arg 1-result functions
func HashSetCopy ¶
func HashSetCopy[Elt any](domain HashDomain[Elt]) func(Visitable[Elt]) MutableSet[Elt]
func Identity1 ¶
func Identity1[Val any](val Val) Val
Identity1 is useful in reduers where the accumulator has the same type as the result
func MGRWithVersion ¶
func MGRWithVersion(gr metav1.GroupResource, version string) metav1.GroupVersionResource
func MapAddAll ¶
func MapAddAll[Key, Val any](theMap MutableMap[Key, Val], adds Visitable[Pair[Key, Val]])
func MapApply ¶
func MapApply[Key, Val any](theMap Map[Key, Val], receiver MappingReceiver[Key, Val])
func MapEnumerateDifferences ¶
func MapEnumerateDifferences[Key, Val comparable](left, right Map[Key, Val], receiver MapChangeReceiver[Key, Val])
func MapEnumerateDifferencesParametric ¶
func MapEnumerateDifferencesParametric[Key, Val any](isEqual func(Val, Val) bool, left, right Map[Key, Val], receiver MapChangeReceiver[Key, Val])
func MapEqual ¶
func MapEqual[Key, Val comparable](left, right Map[Key, Val]) bool
func MapEqualParametric ¶
func MapEqualParametric[Key comparable, Val any](isEqual func(Val, Val) bool) func(map1, map2 Map[Key, Val]) bool
func MapGetAdd ¶
func MapGetAdd[Key, Val any](theMap MutableMap[Key, Val], key Key, want bool, valGenerator func(Key) Val) Val
MapGetAdd does a Get and an add if the sought mmapping is missing and desired. If the sought mapping is missing and undesired then the result is the zero value of Val.
func MapRemoveAll ¶
func MapRemoveAll[Key, Val any](theMap MutableMap[Key, Val], goners Visitable[Pair[Key, Val]])
func MapSetAddNoResult ¶
func MapSetAddNoResult[Elt comparable](set MapSet[Elt], elt Elt)
func MapTransformToSlice ¶
func MapUpdateToMatch ¶
func MapUpdateToMatch[Key, Val comparable](current MutableMap[Key, Val], target Visitable[Pair[Key, Val]])
func MappingReceiverAsVisitor ¶
func MappingReceiverAsVisitor[Key, Val any](receiver MappingReceiver[Key, Val]) func(Pair[Key, Val]) error
func MappingReceiverNegativeAsVisitor ¶
func MappingReceiverNegativeAsVisitor[Key, Val any](receiver MappingReceiver[Key, Val]) func(Pair[Key, Val]) error
func MetaGroupResourceToSchema ¶
func MetaGroupResourceToSchema(gr metav1.GroupResource) schema.GroupResource
func NewDynamicFullJoin12VWith13 ¶
func NewDynamicFullJoin12VWith13[ColX, ColY, ColZ comparable, Val any](logger klog.Logger, receiver MappingReceiver[Triple[ColX, ColY, ColZ], Val]) (MappingReceiver[Pair[ColX, ColY], Val], SetWriter[Pair[ColX, ColZ]])
NewDynamicFullJoin12VWith13 constructs a data structure that incrementally maintains an equijoin of (1) a map from pairs to values with (2) a pair set. The join is on the pair first members. Given a receiver of changes to the result of the equijoin, this function returns receivers of changes to the two ipnputs. In other words, this joins the change streams of two tables to produce the change stream of the join of those two tables --- in a passive stance (i.e., is in terms of the stream receivers).
func NewDynamicFullJoin12with13 ¶
func NewDynamicFullJoin12with13[ColX, ColY, ColZ comparable](logger klog.Logger, receiver SetWriter[Triple[ColX, ColY, ColZ]]) (SetWriter[Pair[ColX, ColY]], SetWriter[Pair[ColX, ColZ]])
NewDynamicFullJoin12with13 is like NewDynamicJoin12with13 but passes along the set of joint values too.
func NewDynamicFullJoin12with13Parametric ¶
func NewDynamicFullJoin12with13Parametric[ColX, ColY, ColZ any](logger klog.Logger, hashDomainX HashDomain[ColX], hashDomainY HashDomain[ColY], hashDomainZ HashDomain[ColZ], receiver SetWriter[Triple[ColX, ColY, ColZ]]) (SetWriter[Pair[ColX, ColY]], SetWriter[Pair[ColX, ColZ]])
NewDynamicFullJoin12with13Parametric is like NewDynamicFullJoin12with13 but is based on general hash maps
func NewDynamicJoin12with13 ¶
func NewDynamicJoin12with13[ColX, ColY, ColZ comparable](logger klog.Logger, receiver SetWriter[Pair[ColY, ColZ]]) (SetWriter[Pair[ColX, ColY]], SetWriter[Pair[ColX, ColZ]])
NewDynamicJoin12with13 constructs a data structure that incrementally maintains an equijoin. The join is on the first column of the input tables. Given a receiver of changes to the result of the equijoin between two two-column tables, this function returns receivers of changes to the two tables. In other words, this joins the change streams of two tables to produce the change stream of the join of those two tables --- in a passive stance (i.e., is in terms of the stream receivers). Note: the uniformity of the input and output types means that this can be chained.
func NewGenericIndexedSet ¶
func NewGenericIndexedSet[Tuple, Key, Val, ValMutableSet, ValSet any]( factoring Factorer[Tuple, Key, Val], valSetFactory func(Key) ValMutableSet, valMutableSetAsSet func(ValMutableSet) MutableSet[Val], insulateValSet func(ValMutableSet) ValSet, rep MutableMap[Key, ValMutableSet], ) *genericMutableIndexedSet[Tuple, Key, Val, ValMutableSet, ValSet]
NewGenericIndexedSet constructs an index given the constituent functionality. The returned value implements GenericMutableIndexedSet.
func NewHashMap ¶
func NewHashMap[Key, Val any](domain HashDomain[Key]) func(MapChangeReceiver[Key, Val]) MutableMap[Key, Val]
func NewMapMapFactory ¶
func NewMapMapFactory[Key comparable, Val any](observer MapChangeReceiver[Key, Val]) func() MutableMap[Key, Val]
NewMapMapFactory makes a func that returns new Map implemented by a Map, optionally with a given observer. In other words, this is the curried form of NewMapMap.
func NewPair1Then2 ¶
func NewPair2Then1 ¶
func NewPlacementTranslator ¶
func NewPlacementTranslator( numThreads int, ctx context.Context, epClusterPreInformer edgev1a1informers.EdgePlacementClusterInformer, spsClusterPreInformer edgev1a1informers.SinglePlacementSliceClusterInformer, syncfgClusterPreInformer edgev1a1informers.SyncerConfigClusterInformer, mbwsPreInformer tenancyv1a1informers.WorkspaceInformer, kcpClusterClientset kcpclusterclientset.ClusterInterface, discoveryClusterClient clusterdiscovery.DiscoveryClusterInterface, crdClusterPreInformer kcpkubeinformers.GenericClusterInformer, bindingClusterPreInformer kcpkubeinformers.GenericClusterInformer, dynamicClusterClient clusterdynamic.ClusterInterface, edgeClusterClientset edgeclusterclientset.ClusterInterface, nsClusterPreInformer kcpkubecorev1informers.NamespaceClusterInformer, nsClusterClient kcpkubecorev1client.NamespaceClusterInterface, ) *placementTranslator
func NewWorkloadProjector ¶
func NewWorkloadProjector( ctx context.Context, configConcurrency int, resourceModes ResourceModes, mbwsInformer k8scache.SharedIndexInformer, mbwsLister tenancyv1a1listers.WorkspaceLister, syncfgClusterInformer kcpcache.ScopeableSharedIndexInformer, syncfgClusterLister edgev1a1listers.SyncerConfigClusterLister, edgeClusterClientset edgeclusterclientset.ClusterInterface, dynamicClusterClient clusterdynamic.ClusterInterface, nsClusterPreInformer kcpkubecorev1informers.NamespaceClusterInformer, nsClusterClient kcpkubecorev1client.NamespaceClusterInterface, ) *workloadProjector
NewWorkloadProjector constructs a WorkloadProjector that also implements Runnable. Run it after starting the informer factories.
func ObjectIsSystem ¶
func ResourceSupportsInformers ¶
func ResourceSupportsInformers(metarsc *urmetav1a1.APIResource) bool
func SPMailboxWorkspaceName ¶
func SPMailboxWorkspaceName(sp SinglePlacement) string
func SetAddAll ¶
func SetAddAll[Elt any](set MutableSet[Elt], adds Visitable[Elt]) (someNew, allNew bool)
func SetEnumerateDifferences ¶
func SetLessOrEqual ¶
func SetRemoveAll ¶
func SetRemoveAll[Elt any](set MutableSet[Elt], goners Visitable[Elt]) (someNew, allNew bool)
func SetUpdateToMatch ¶
func SetUpdateToMatch[Elt comparable](current MutableSet[Elt], target Visitable[Elt], eltChangeReceiver SetWriter[Elt])
func SliceApply ¶
func SliceApply[Elt any](slice []Elt, fn func(Elt))
func SliceContains ¶
func SliceContains[Elt comparable](slice []Elt, seek Elt) bool
func SliceContainsParametric ¶
func SliceEqual ¶
func SliceEqual[Elt comparable](a, b []Elt) bool
func SliceRemoveFunctional ¶
func SliceRemoveFunctional[Elt comparable](slice []Elt, seek Elt) []Elt
func UpsyncSetEqual ¶
func VisitableHas ¶
func VisitableHas[Elt comparable](set Visitable[Elt], seek Elt) bool
func VisitableLen ¶
func VisitableMapFnReduceOr ¶
func VisitableToSlice ¶
Types ¶
type APIGroupInfo ¶
type APIGroupInfo struct { // Versions are ordered as semantic versions. // This slice is immutable. Versions []metav1.GroupVersionForDiscovery PreferredVersion metav1.GroupVersionForDiscovery }
type APIMapProvider ¶
type APIMapProvider interface { // Neither receiver is invoked synchronously. AddReceivers(cluster logicalcluster.Name, groupReceiver *MappingReceiverHolder[string, APIGroupInfo], resourceReceiver *MappingReceiverHolder[metav1.GroupResource, ResourceDetails]) // The receiver values have to be comparable. // Neither receiver is invoked synchronously. RemoveReceivers(cluster logicalcluster.Name, groupReceiver *MappingReceiverHolder[string, APIGroupInfo], resourceReceiver *MappingReceiverHolder[metav1.GroupResource, ResourceDetails]) }
APIMapProvider provides API information on a cluster-by-cluster basis, as needed by clients. This information comes from runtime monitoring of the API resources of the clusters. In the locking order, an resourceDiscoveryReceiver is _preceded_ by its clients.
type APIWatchMapProvider ¶
type APIWatchMapProvider interface { APIMapProvider Runnable }
func NewAPIWatchMapProvider ¶
func NewAPIWatchMapProvider(ctx context.Context, numThreads int, discoveryClusterClient clusterdiscovery.DiscoveryClusterInterface, crdClusterPreInformer kcpinformers.GenericClusterInformer, bindingClusterPreInformer kcpinformers.GenericClusterInformer, ) APIWatchMapProvider
NewAPIWatchMapProvider constructs an APIMapProvider that gets its information from apiwatch.
type BindingOrganizer ¶
type BindingOrganizer func(discovery APIMapProvider, resourceModes ResourceModes, eventHandler EventHandler, workloadProjector WorkloadProjector) SingleBinder
BindingOrganizer takes a WorkloadProjector and produces a SingleBinder that takes the atomized bindings and reorganizes them and resolves the API group version issue to feed the WorkloadProjector. A SetBinder implementation will likely use one of these to drive its WorkloadProjector, feeding the SingleBinder atomized changes from the incoming ResolvedWhat and ResolvedWhere values. The given EventHandler is given events that the organizer produces and publishes them somewhere.
func SimpleBindingOrganizer ¶
func SimpleBindingOrganizer(logger klog.Logger) BindingOrganizer
SimpleBindingOrganizer constructs a BindingOrganizer. It is not so simple any more. See the comment on the implementation for the queries and the query plan that implement this thing.
type ClientTracker ¶
type ClientTracker[Provider any] struct { // contains filtered or unexported fields }
ClientTracker keeps track of a set of clients and reports when RemoveClient removed the last of them. NOT safe for concurrent use.
func NewClientTracker ¶
func NewClientTracker[Provider any]() *ClientTracker[Provider]
func (*ClientTracker[Provider]) AddClient ¶
func (ct *ClientTracker[Provider]) AddClient(client Client[Provider])
func (*ClientTracker[Provider]) IsEmpty ¶
func (ct *ClientTracker[Provider]) IsEmpty() bool
func (*ClientTracker[Provider]) RemoveClient ¶
func (ct *ClientTracker[Provider]) RemoveClient(client Client[Provider]) bool
func (*ClientTracker[Provider]) SetProvider ¶
func (ct *ClientTracker[Provider]) SetProvider(provider Provider)
type ClusterWhatWhereFullKey ¶
type ClusterWhatWhereFullKey = Triple[ExternalName, Pair[metav1.GroupResource, string], SinglePlacement]
ClusterWhatWhereFullKey is (EdgePlacement id, (resource, object name), destination)
type Comparison ¶
type Comparison struct{ LessOrEqual, GreaterOrEqual bool }
func SetCompare ¶
func SetCompare[Elt any](set1, set2 Set[Elt]) Comparison
func (Comparison) IsEqual ¶
func (comp Comparison) IsEqual() bool
func (Comparison) IsRelated ¶
func (comp Comparison) IsRelated() bool
func (Comparison) IsStrictlyGreater ¶
func (comp Comparison) IsStrictlyGreater() bool
func (Comparison) IsStrictlyLess ¶
func (comp Comparison) IsStrictlyLess() bool
func (Comparison) Reverse ¶
func (comp Comparison) Reverse() Comparison
type DownsyncsDifferencerConstructor ¶
type DownsyncsDifferencerConstructor = MapDifferenceConstructor[WorkloadParts, WorkloadPartID, WorkloadPartDetails]
type DynamicMapProvider ¶
type DynamicMapProvider[Key comparable, Val any] interface { // AddReceiver causes the given receiver to be notified of following // changes and, if notifyCurrent, the current map contents. // If receivers are comparable: depending on the implementation, // successive adds of the same receiver have no more effect than // the first add, or lead to duplicated callbacks to the receiver. // The producer precedes each receiver in the locking order. AddReceiver(receiver MappingReceiver[Key, Val], notifyCurrent bool) // Get invokes the given function on the value corresponding to the key. // This does not count as informing any particular receiver. // The producer precedes the function in the locking order. Get(Key, func(Val)) }
DynamicMapProvider holds a mutable map and keeps clients appraised of it. The zero value of Val signals a missing entry in the map.
type DynamicMapProviderWithRelease ¶
type DynamicMapProviderWithRelease[Key comparable, Val any] interface { DynamicMapProvider[Key, Val] // MaybeRelease invokes the given function on the value corresponding to the // given key and, if the function returns true, may release some internal resources // associated with that key. // The producer precedes the given function in the locking order. MaybeRelease(Key, func(Val) bool) }
type DynamicValueProvider ¶
type Emptyable ¶
type Emptyable interface {
IsEmpty() bool
}
Emptyable is something that can be tested for emptiness. The thing may or may not be mutable. This view of the thing may or may not have a limited scope of validity. This view may or may not have concurrency restrictions.
type EventHandler ¶
EventHandler can be given Event objects.
type ExternalName ¶
type ExternalName struct { // Cluster identifies the cluster. It is the one-part ID, not a path. Cluster logicalcluster.Name Name string }
ExternalName identifies a cluster-scoped object of some implicit kind
func NewExternalName ¶
func NewExternalName(cluster, name string) ExternalName
NewExternalName assumes the given cluster identifier is proper
func (ExternalName) OfSPLocation ¶
func (ExternalName) OfSPLocation(sp SinglePlacement) ExternalName
func (ExternalName) OfSPTarget ¶
func (ExternalName) OfSPTarget(sp SinglePlacement) ExternalName
func (ExternalName) String ¶
func (en ExternalName) String() string
type FactoredMap ¶
type FactoredMap[WholeKey, KeyPartA, KeyPartB comparable, Val any] interface { MutableMap[WholeKey, Val] GetIndex() FactoredMapIndex[KeyPartA, KeyPartB, Val] }
FactoredMap is a map implemented by two levels of mapping. It has a general key decomposition/composition rotator.
func NewFactoredMap ¶
func NewFactoredMap[WholeKey, KeyPartA, KeyPartB comparable, Val any]( keyDecomposer Factorer[WholeKey, KeyPartA, KeyPartB], innerMapConstructor func() MutableMap[KeyPartB, Val], outerMap MutableMap[KeyPartA, MutableMap[KeyPartB, Val]], unifiedObserver MapChangeReceiver[WholeKey, Val], outerObserver MappingReceiver[KeyPartA, Map[KeyPartB, Val]], ) FactoredMap[WholeKey, KeyPartA, KeyPartB, Val]
NewFactoredMap creates a factored map implemented by the given outer map and constructor of inner maps.
func NewFactoredMapMap ¶
func NewFactoredMapMap[WholeKey, KeyPartA, KeyPartB comparable, Val any]( keyDecomposer Factorer[WholeKey, KeyPartA, KeyPartB], unifiedObserver MapChangeReceiver[WholeKey, Val], outerKeysetObserver SetChangeReceiver[KeyPartA], outerObserver2 MappingReceiver[KeyPartA, Map[KeyPartB, Val]], ) FactoredMap[WholeKey, KeyPartA, KeyPartB, Val]
NewFactoredMapMap makes a FactoredMap implements by golang maps.
func NewFactoredMapMapAggregator ¶
func NewFactoredMapMapAggregator[WholeKey, KeyPartA, KeyPartB comparable, Val any, Aggregation any]( keyDecomposer Factorer[WholeKey, KeyPartA, KeyPartB], unifiedObserver MapChangeReceiver[WholeKey, Val], outerKeysetObserver SetChangeReceiver[KeyPartA], aggregate func(KeyPartA, Map[KeyPartB, Val]) Aggregation, aggregationObserver MappingReceiver[KeyPartA, Aggregation], ) FactoredMap[WholeKey, KeyPartA, KeyPartB, Val]
NewFactoredMapMapAggregator makes a FactoredMap that also notifies a receiver of updates to a GROUP BY KeyPartA & aggregate.
type FactoredMapIndex ¶
type FactoredMapIndex[KeyPartA, KeyPartB comparable, Val any] interface { Map[KeyPartA, Map[KeyPartB, Val]] Visit1to2(KeyPartA, func(Pair[KeyPartB, Val]) error) error }
FactoredMapIndex is an index into a factored map.
type Factorer ¶
Factorer is a Rotator that converts from some Whole type to some Pair type (and back)
func NewFactorer ¶
func PairFactorer ¶
func QuadFactorerTo1and234 ¶
func TripleFactorerTo13and2 ¶
func TripleFactorerTo1and23 ¶
func TripleFactorerTo23and1 ¶
func TripleFactorerTo3and21 ¶
type GenericIndexedSet ¶
type GenericIndexedSet[Tuple, Key, Val, ValSet any] interface { Set[Tuple] GetIndex1to2() Index2[Key, Val, ValSet] }
GenericIndexedSet is a readonly set of Tuple whose representation is based on factoring each Tuple into Key and Val parts and using a map from Key to set of Val. Making the Val set type a type parameter allows the use of this in contexts where the Val set itself has interesting properties beyond just being a set of Val. For example, this construction can be thus nested in a way that makes the inner structure available.
func GenericMutableIndexedSetToReadonly ¶
func GenericMutableIndexedSetToReadonly[Tuple, Key, Val, ValMutableSet, ValSet any](gi *genericMutableIndexedSet[Tuple, Key, Val, ValMutableSet, ValSet]) GenericIndexedSet[Tuple, Key, Val, ValSet]
type GenericMutableIndexedSet ¶
type GenericMutableIndexedSet[Tuple, Key, Val, ValSet any] interface { GenericIndexedSet[Tuple, Key, Val, ValSet] MutableSet[Tuple] // AsReadonly returns a view that does not support writes AsReadonly() GenericIndexedSet[Tuple, Key, Val, ValSet] }
GenericMutableIndexedSet is a GenericIndexedSet that also provides write access.
type GroupResourceInstance ¶
type GroupResourceInstance = Pair[metav1.GroupResource, string]
type HashDomain ¶
func NewSliceHashDomain ¶
func NewSliceHashDomain[Elt any](eltDomain HashDomain[Elt]) HashDomain[[]Elt]
func NewTransformHashDomain ¶
func NewTransformHashDomain[Original, Transformed any](tranform func(Original) Transformed, transformedDomain HashDomain[Transformed]) HashDomain[Original]
func PairHashDomain ¶
func PairHashDomain[First, Second any](first HashDomain[First], second HashDomain[Second]) HashDomain[Pair[First, Second]]
func TripleHashDomain ¶
func TripleHashDomain[First, Second, Third any](first HashDomain[First], second HashDomain[Second], third HashDomain[Third]) HashDomain[Triple[First, Second, Third]]
type HashDomainFuncs ¶
func NewHashDomainFuncs ¶
func NewHashDomainFuncs[Elt any](equal func(Elt, Elt) bool, hash func(Elt) HashValue) HashDomainFuncs[Elt]
func (HashDomainFuncs[Elt]) Equal ¶
func (hdf HashDomainFuncs[Elt]) Equal(left, right Elt) bool
func (HashDomainFuncs[Elt]) Hash ¶
func (hdf HashDomainFuncs[Elt]) Hash(elt Elt) HashValue
type HashDomainString ¶
type HashDomainString struct{}
func (HashDomainString) Equal ¶
func (HashDomainString) Equal(left, right string) bool
func (HashDomainString) Hash ¶
func (HashDomainString) Hash(arg string) HashValue
type HashSinglePlacement ¶
type HashSinglePlacement struct{}
func (HashSinglePlacement) Equal ¶
func (HashSinglePlacement) Equal(left, right SinglePlacement) bool
func (HashSinglePlacement) Hash ¶
func (HashSinglePlacement) Hash(arg SinglePlacement) HashValue
type HashUpsyncSet ¶
type HashUpsyncSet struct{}
type Map ¶
type Map[Key, Val any] interface { Emptyable Len() int LenIsCheap() bool Get(Key) (Val, bool) Visitable[Pair[Key, Val]] }
Map is a finite set of (key,value) pairs that has at most one value for any given key. The collection may or may not be mutable. This view of the collection may or may not have a limited scope of validity. This view may or may not have concurrency restrictions.
func MapEquijoin12With13 ¶
func MapReadonly ¶
MapReadonly returns a version of the argument that does not support writes
func NewMapToConstant ¶
func NewMapToConstant[Key comparable, Val any](keys Set[Key], val Val) Map[Key, Val]
func RotateKeyMap ¶
func RotateKeyMap[Original, Rotated comparable, Val any](rotator Rotator[Original, Rotated], inner Map[Rotated, Val]) Map[Original, Val]
RotateKeyMap rotates the key space of a Map. The given Map has keys that are rotated forward, according to the given Rotator, from the returned Map.
type MapChangeReceiver ¶
type MapChangeReceiver[Key, Val any] interface { Create(Key, Val) // Update is given key, old value, new value Update(Key, Val, Val) // DeleteWithFinal is given key and last value DeleteWithFinal(Key, Val) }
MapChangeReceiver is what a stateful map offers to an observer
func MapKeySetReceiver ¶
func MapKeySetReceiver[Key, Val any](ksr SetWriter[Key]) MapChangeReceiver[Key, Val]
MapKeySetReceiver extends a SetWriter for keys into a MapChangeReceiver that simply ignores the associated values.
func MappingReceiverDiscardsPrevious ¶
func MappingReceiverDiscardsPrevious[Key, Val any](mr MappingReceiver[Key, Val]) MapChangeReceiver[Key, Val]
MappingReceiverDiscardsPrevious produces a MapChangeReceiver that dumbs down its info to pass along to the given MappingReceiver
type MapChangeReceiverFork ¶
type MapChangeReceiverFork[Key, Val any] []MapChangeReceiver[Key, Val]
func (MapChangeReceiverFork[Key, Val]) Create ¶
func (mrf MapChangeReceiverFork[Key, Val]) Create(key Key, val Val)
func (MapChangeReceiverFork[Key, Val]) DeleteWithFinal ¶
func (mrf MapChangeReceiverFork[Key, Val]) DeleteWithFinal(key Key, val Val)
func (MapChangeReceiverFork[Key, Val]) Update ¶
func (mrf MapChangeReceiverFork[Key, Val]) Update(key Key, oldVal, newVal Val)
type MapChangeReceiverFuncs ¶
type MapChangeReceiverFuncs[Key, Val any] struct { OnCreate func(Key, Val) OnUpdate func(Key, Val, Val) OnDelete func(Key, Val) }
MapChangeReceiverFuncs is a convenient constructor of MapChangeReceiver from three funcs
func (MapChangeReceiverFuncs[Key, Val]) Create ¶
func (mrf MapChangeReceiverFuncs[Key, Val]) Create(key Key, val Val)
func (MapChangeReceiverFuncs[Key, Val]) DeleteWithFinal ¶
func (mrf MapChangeReceiverFuncs[Key, Val]) DeleteWithFinal(key Key, val Val)
func (MapChangeReceiverFuncs[Key, Val]) Update ¶
func (mrf MapChangeReceiverFuncs[Key, Val]) Update(key Key, oldVal, newVal Val)
type MapDifferenceConstructor ¶
type MapDifferenceConstructor[Map any, Key, Val comparable] func(MapChangeReceiver[Key, Val]) Receiver[Map]
MapDifferenceConstructor is a function that is given a receiver of map differences and returns a receiver of maps that keeps track of the latest map and keeps the difference receiver informed of differences as they arrive. The map differencer precedes the map difference receiver in the locking order.
type MapMap ¶
type MapMap[Key comparable, Val any] struct { // contains filtered or unexported fields }
func MapMapCopy ¶
func MapMapCopy[Key comparable, Val any](observer MapChangeReceiver[Key, Val], other Visitable[Pair[Key, Val]]) MapMap[Key, Val]
MapMapCopy creates a new MapMap holding what the given Visitable reported at construction time.
func MintMapMap ¶
func MintMapMap[Key comparable, Val any](theMap map[Key]Val, observer MapChangeReceiver[Key, Val]) MapMap[Key, Val]
MintMapMap takes the given map and obervers puts the MapMap seal of approval on them. It is the user's responsibility to not surprise themself.
func NewMapMap ¶
func NewMapMap[Key comparable, Val any](observer MapChangeReceiver[Key, Val]) MapMap[Key, Val]
NewMapMap makes a new Map implemented by a Map, optionally with a given observer. For providing initial values see AddArgs, AddAllByVisit, MapMapCopy below.
func (MapMap[Key, Val]) AddAllByVisit ¶
AddAllByVisit enumerates the given Visitable and adds every pair enumerated, in order, and returns the Map itself.
func (MapMap[Key, Val]) AddArgs ¶
AddArgs adds the given pairs and returns the map itself. The pairs are added in the order given.
func (MapMap[Key, Val]) LenIsCheap ¶
type MapSet ¶
type MapSet[Elt comparable] map[Elt]Empty
func MapSetCopy ¶
func MapSetCopy[Elt comparable](source Visitable[Elt]) MapSet[Elt]
func NewEmptyMapSet ¶
func NewEmptyMapSet[Elt comparable]() MapSet[Elt]
func NewMapSet ¶
func NewMapSet[Elt comparable](elts ...Elt) MapSet[Elt]
func (MapSet[Elt]) LenIsCheap ¶
type MapToConstant ¶
type MapToConstant[Key comparable, Val any] struct { // contains filtered or unexported fields }
func (MapToConstant[Key, Val]) Get ¶
func (mtc MapToConstant[Key, Val]) Get(key Key) (Val, bool)
func (MapToConstant[Key, Val]) IsEmpty ¶
func (mtc MapToConstant[Key, Val]) IsEmpty() bool
func (MapToConstant[Key, Val]) Len ¶
func (mtc MapToConstant[Key, Val]) Len() int
func (MapToConstant[Key, Val]) LenIsCheap ¶
func (mtc MapToConstant[Key, Val]) LenIsCheap() bool
type MappingReceiver ¶
type MappingReceiver[Key, Val any] interface { Put(Key, Val) Delete(Key) }
MappingReceiver is something that can be given key/value pairs. This is the writable aspect of a Map. Some DynamicMapProvider implementations require receivers to be comparable.
func MapKeySetReceiverLossy ¶
func MapKeySetReceiverLossy[Key, Val any](ksr SetWriter[Key]) MappingReceiver[Key, Val]
MapKeySetReceiverLossy extends a SetWriter for keys into a MappingReceiver that simply ignores the associated values. It is lossy in that it may make redundant calls to Add.
func MappingReceiverFunc ¶
func MappingReceiverFunc[Key, Val any](fn func() MappingReceiver[Key, Val]) MappingReceiver[Key, Val]
MappingReceiverFunc produces a MappingReceiver that defers to another MappingReceiver computed on each use
func NewLoggingMappingReceiver ¶
func NewLoggingMappingReceiver[Key comparable, Val any](mapName string, logger klog.Logger) MappingReceiver[Key, Val]
func NewMappingReceiverFuncs ¶
func NewMappingReceiverFuncs[Key, Val any](put func(Key, Val), delete func(Key)) MappingReceiver[Key, Val]
func RotateMappingReceiver ¶
func RotateMappingReceiver[Original, Rotated comparable, Val any](rotator Rotator[Original, Rotated], inner MappingReceiver[Rotated, Val]) MappingReceiver[Original, Val]
RotateMappingReceiver rotates the key space of a MappingReceiver.
type MappingReceiverFork ¶
type MappingReceiverFork[Key, Val any] []MappingReceiver[Key, Val]
func NewMappingReceiverFork ¶
func NewMappingReceiverFork[Key, Val any](elts ...MappingReceiver[Key, Val]) MappingReceiverFork[Key, Val]
func (MappingReceiverFork[Key, Val]) Delete ¶
func (mrf MappingReceiverFork[Key, Val]) Delete(key Key)
func (MappingReceiverFork[Key, Val]) Put ¶
func (mrf MappingReceiverFork[Key, Val]) Put(key Key, val Val)
type MappingReceiverFuncs ¶
type MappingReceiverFuncs[Key, Val any] struct { OnPut func(Key, Val) OnDelete func(Key) }
MappingReceiverFuncs is a convenient constructor of MappingReceiver from two funcs
func (MappingReceiverFuncs[Key, Val]) Create ¶
func (mrf MappingReceiverFuncs[Key, Val]) Create(key Key, val Val)
func (MappingReceiverFuncs[Key, Val]) Delete ¶
func (mrf MappingReceiverFuncs[Key, Val]) Delete(key Key)
func (MappingReceiverFuncs[Key, Val]) DeleteWithFinal ¶
func (mrf MappingReceiverFuncs[Key, Val]) DeleteWithFinal(key Key, oldVal Val)
func (MappingReceiverFuncs[Key, Val]) Put ¶
func (mrf MappingReceiverFuncs[Key, Val]) Put(key Key, val Val)
func (MappingReceiverFuncs[Key, Val]) Update ¶
func (mrf MappingReceiverFuncs[Key, Val]) Update(key Key, oldVal, newVal Val)
type MappingReceiverHolder ¶
type MappingReceiverHolder[Key, Val any] struct{ MappingReceiver[Key, Val] }
Pointers to these are comparable, unlike `MappingReceiver` in go 1.19
type MappingReceiverHolderFork ¶
type MappingReceiverHolderFork[Key, Val any] []*MappingReceiverHolder[Key, Val]
func (MappingReceiverHolderFork[Key, Val]) Delete ¶
func (mrf MappingReceiverHolderFork[Key, Val]) Delete(key Key)
func (MappingReceiverHolderFork[Key, Val]) Put ¶
func (mrf MappingReceiverHolderFork[Key, Val]) Put(key Key, val Val)
type MutableIndex2 ¶
type MutableMap ¶
type MutableMap[Key, Val any] interface { Map[Key, Val] MappingReceiver[Key, Val] }
MutableMap is a Map that can be written to.
func MutableMapWithKeyObserver ¶
func MutableMapWithKeyObserver[Key, Val any](mm MutableMap[Key, Val], observer SetWriter[Key]) MutableMap[Key, Val]
func RotatedKeyMutableMap ¶
func RotatedKeyMutableMap[Original, Rotated comparable, Val any](rotator Rotator[Original, Rotated], inner MutableMap[Rotated, Val]) MutableMap[Original, Val]
func WrapMapWithMutex ¶
func WrapMapWithMutex[Key comparable, Val any](theMap MutableMap[Key, Val]) MutableMap[Key, Val]
type MutableRelation2 ¶
type MutableRelation2[First, Second any] interface { Relation2[First, Second] MutableSet[Pair[First, Second]] }
func Relation2WithObservers ¶
func Relation2WithObservers[First, Second any](inner MutableRelation2[First, Second], observers ...SetWriter[Pair[First, Second]]) MutableRelation2[First, Second]
type MutableSet ¶
func NewHashSet ¶
func NewHashSet[Elt any](domain HashDomain[Elt], elts ...Elt) MutableSet[Elt]
NewHashSet creates a new set based on a hash map
func NewSetByMapToEmpty ¶
func NewSetByMapToEmpty[Elt any](theMap MutableMap[Elt, Empty]) MutableSet[Elt]
NewSetByMapToEmpty takes a mutable map to Empty and returns the behavior of its key set. For the readonly version, see MapKeySet.
func WrapSetWithMutex ¶
func WrapSetWithMutex[Elt any](inner MutableSet[Elt]) MutableSet[Elt]
type NamespaceAndDestination ¶
type NamespaceAndDestination = Pair[NamespaceName, SinglePlacement]
type NamespaceDistributionTuple ¶
type NamespaceDistributionTuple = Triple[logicalcluster.Name, NamespaceName, SinglePlacement]
type NamespaceName ¶
type NamespaceName string
type NamespacedJoinKeyLessnS ¶
type NamespacedJoinKeyLessnS = Triple[logicalcluster.Name, metav1.GroupResource, SinglePlacement]
type NamespacedResourceDistributionTuple ¶
type NamespacedResourceDistributionTuple struct { SourceCluster logicalcluster.Name ProjectionModeKey }
type NamespacedWhatWhereFullKey ¶
type NamespacedWhatWhereFullKey = Triple[ExternalName, NamespaceName, SinglePlacement]
type NatureMode ¶
type NatureMode string
NatureMode describes the stance regarding whether a resource is denatured in the center. All resources that go to the edge are natured (not denatured) at the edge.
const ( // NaturalyDenatured is a resource that is denatured in the center without any special // effort in this code. NaturalyDenatured NatureMode = "NaturallyDenatured" // NaturallyNatured is a resource that is natured in the center and should be that way. NaturallyNatured NatureMode = "NaturallyNatured" // ForciblyDenatured is a resource that would be given an undesired interpretation in the center // if stored normally in the center, so has to be stored differently in the center (but not // at the edge). ForciblyDenatured NatureMode = "ForciblyDenatured" )
type NonNamespacedDistributionTuple ¶
type NonNamespacedDistributionTuple = Pair[ProjectionModeKey, ExternalName]
type ObjectNameToDestinations ¶
type ObjectNameToDestinations = GenericIndexedSet[Pair[string, SinglePlacement], string, SinglePlacement, Set[SinglePlacement]]
type Pair ¶
type Pair[First, Second any] struct { First First Second Second }
func PairReverse ¶
func PairReverse[First, Second comparable](forward Pair[First, Second]) Pair[Second, First]
type ProjectionKey ¶
type ProjectionKey struct { metav1.GroupResource Destination SinglePlacement }
ProjectionKey identifies the topmost level of organization, the combinatin of the destination and the API group and resource.
type ProjectionModeKey ¶
type ProjectionModeKey struct { GroupResource metav1.GroupResource Destination SinglePlacement }
type ProjectionModeVal ¶
type ProjectionModeVal struct {
APIVersion string // just the version, no group
}
type PropagationMode ¶
type PropagationMode string
PropagationMode describes the relationship between present-in-center and present-in-edge
const ( ErrorInCenter PropagationMode = "error" TolerateInCenter PropagationMode = "tolerate" GoesToMailbox PropagationMode = "tomail" GoesToEdge PropagationMode = "propagate" )
type Quad ¶
type Quad[First, Second, Third, Fourth any] struct { First First Second Second Third Third Fourth Fourth }
type Receiver ¶
type Receiver[Val any] interface { Receive(Val) }
func NewMapDifferenceByMapAndEnum ¶
func NewMapDifferenceByMapAndEnum[MapType any, Key, Val comparable](visitablize func(MapType) Visitable[Pair[Key, Val]], mappingChangeReceiver MapChangeReceiver[Key, Val]) Receiver[MapType]
func NewResolvedWhereDifferencer ¶
func NewResolvedWhereDifferencer(eltChangeReceiver SetWriter[SinglePlacement]) Receiver[ResolvedWhere]
func NewSetDifferenceByMapAndEnum ¶
func NewSetDifferenceByMapAndEnum[SetType any, Elt comparable](visitablize func(SetType) Visitable[Elt], eltChangeReceiver SetWriter[Elt]) Receiver[SetType]
func NewSliceDifferencerParametric ¶
func NewSliceDifferencerParametric[Elt any](isEqual func(Elt, Elt) bool, changeReceiver SetChangeReceiver[Elt], initial []Elt) Receiver[[]Elt]
func NewUpsyncDifferencer ¶
func NewWorkloadPartsDifferencer ¶
func NewWorkloadPartsDifferencer(mappingReceiver MapChangeReceiver[WorkloadPartID, WorkloadPartDetails]) Receiver[WorkloadParts]
type Reducer ¶
Reducer is something that crunches a collection down into one value
func MapSetCopier ¶
func MapSetCopier[Elt comparable]() Reducer[Elt, MapSet[Elt]]
type Relation2 ¶
type Relation2[First, Second any] interface { Set[Pair[First, Second]] GetIndex1to2() Index2[First, Second, Set[Second]] }
Relation2 is a set of 2-tuples.
func Relation2Equijoin12with13 ¶
func Relation2Equijoin12with13[First, Second, Third comparable](left Relation2[First, Second], right Relation2[First, Third]) Relation2[Second, Third]
type RelayMap ¶
type RelayMap[Key comparable, Val any] TransformingRelayMap[Key, Val, Val]
func NewRelayMap ¶
func NewRelayMap[Key comparable, Val any](dedupReceivers bool) RelayMap[Key, Val]
func RelayWhatResolver ¶
func RelayWhatResolver() RelayMap[ExternalName, WorkloadParts]
func RelayWhereResolver ¶
func RelayWhereResolver() RelayMap[ExternalName, ResolvedWhere]
type ResolvedWhat ¶
type ResolvedWhat struct { Downsync WorkloadParts Upsync []edgeapi.UpsyncSet }
ResolvedWhat describes what to downsync and what to upsync for a given (workload management workspace, edge cluster) pair.
type ResolvedWhere ¶
type ResolvedWhere []*edgeapi.SinglePlacementSlice
ResolvedWhere identifies the set of SyncTargets that match a certain EdgePlacement's "where" predicate. Each `*edgeapi.SinglePlacementSlice` points to an immutable object.
func (ResolvedWhere) Has ¶
func (rw ResolvedWhere) Has(seek SinglePlacement) bool
func (ResolvedWhere) IsEmpty ¶
func (rw ResolvedWhere) IsEmpty() bool
func (ResolvedWhere) Len ¶
func (rw ResolvedWhere) Len() int
func (ResolvedWhere) LenIsCheap ¶
func (rw ResolvedWhere) LenIsCheap() bool
func (ResolvedWhere) String ¶
func (where ResolvedWhere) String() string
func (ResolvedWhere) Visit ¶
func (rw ResolvedWhere) Visit(visitor func(SinglePlacement) error) error
type ResolvedWhereDifferencerConstructor ¶
type ResolvedWhereDifferencerConstructor = SetDifferencerConstructor[ResolvedWhere, SinglePlacement]
type ResourceDetails ¶
ResourceDetails holds the information needed here about a resource
type ResourceDiscoveryKey ¶
type ResourceDiscoveryKey = Pair[logicalcluster.Name, metav1.GroupResource]
type ResourceMode ¶
type ResourceMode struct { PropagationMode PropagationMode NatureMode NatureMode BuiltinToEdge bool }
ResourceMode describes how a given resource is handled regarding propagation and denaturing.
func DefaultResourceModes ¶
func DefaultResourceModes(mgr metav1.GroupResource) ResourceMode
func (ResourceMode) GoesToEdge ¶
func (rscMode ResourceMode) GoesToEdge() bool
GoesToEdge tells whether objects of this sort can downsync all the way to the edge cluster
func (ResourceMode) GoesToMailbox ¶
func (rscMode ResourceMode) GoesToMailbox() bool
GoesToMailbox tells whether objects of this sort can downsync at least as far as the mailbox workspace
type ResourceModes ¶
type ResourceModes func(metav1.GroupResource) ResourceMode
ResourceModes tells the handling of the given resource. This information comes from platform configuration and code. Immutable.
type Rotator ¶
Rotator is something that can change one value into an equivalent value and back again. To understand the name, think of something that can rotate (forward and back) a point in some coordinate system.
func NewRotator ¶
func NoRotation ¶
func PairReverser ¶
func TripleReverser ¶
type Runnable ¶
Runnable is something that can run until a given context is closed
func AssemplePlacementTranslator ¶
func AssemplePlacementTranslator( whatResolver WhatResolver, whereResolver WhereResolver, setBinder SetBinder, workloadProjector WorkloadProjector, ) Runnable
AssemplePlacementTranslator puts together the top-level pieces.
type Set ¶
func MapKeySet ¶
func MapKeySet[Key comparable, Val any](theMap Map[Key, Val]) Set[Key]
MapKeySet produces a readonly view of a given Map's key set. For the passive version, see MapKeySetReceiver and MapKeySetReceiverLossy. For the writable version, see NewSetByMapToEmpty.
func NewSetReadonly ¶
func NewSetReadonly[Elt any](set MutableSet[Elt]) Set[Elt]
func SetIntersection ¶
type SetBinder ¶
type SetBinder func(workloadProjector WorkloadProjector) ( whatReceiver MappingReceiver[ExternalName, ResolvedWhat], whereReceiver MappingReceiver[ExternalName, ResolvedWhere])
SetBinder is a component that is kept appraised of the "what" and "where" resolutions and reorganizing and picking API versions to guide the workload projector. The implementation may atomize the resolved "what" and "where" using differencers constructed by a SetDifferencerConstructor. The implementation may use a BindingOrganizer to get from the atomized "what" and "where" to the ProjectionMappingReceiver behavior.
func NewSetBinder ¶
func NewSetBinder( logger klog.Logger, downsyncPartsDifferencerConstructor DownsyncsDifferencerConstructor, upsyncsDifferenceConstructor UpsyncsDifferenceConstructor, resolvedWhereDifferencerConstructor ResolvedWhereDifferencerConstructor, bindingOrganizer BindingOrganizer, discovery APIMapProvider, resourceModes ResourceModes, eventHandler EventHandler, ) SetBinder
type SetBinderConstructor ¶
type SetBinderConstructor func( logger klog.Logger, downsyncsDifferencerConstructor DownsyncsDifferencerConstructor, upsyncsDifferenceConstructor UpsyncsDifferenceConstructor, resolvedWhereDifferencerConstructor ResolvedWhereDifferencerConstructor, bindingOrganizer BindingOrganizer, discovery APIMapProvider, resourceModes ResourceModes, eventHandler EventHandler, ) SetBinder
SetBinderConstructor is a likely signature for the final assembly of a SetBinder. The differencer constructors will be called to create differencers that translate new whole values of ResolvedWhat and ResolvedWhere into elemental differences. The BindingOrganizer produces a pipe stage that is given those elemental differences and re-organizes them and solves the workload conflicts to supply input to a ProjectionMappingReceiver.
type SetChangeReceiver ¶
SetChangeReceiver is SetWriter shorn of returned information and refactored to a simpler signature. The `bool` is `true` for additions to the set, `false` for removals.
type SetDifferencerConstructor ¶
type SetDifferencerConstructor[Set any, Element comparable] func(SetWriter[Element]) Receiver[Set]
SetDifferencerConstructor is a function that is given a receiver of set differences and returns a receiver of sets that keeps track of the latest set and keeps the difference receiver informed of differences as they arrive. The set differencer precedes the set difference receiver in the locking order.
type SetReadonly ¶
type SetReadonly[Elt any] struct { // contains filtered or unexported fields }
SetReadonly is a wrapper that removes the ability to write to the set
func (SetReadonly[Elt]) Has ¶
func (sr SetReadonly[Elt]) Has(elt Elt) bool
func (SetReadonly[Elt]) IsEmpty ¶
func (sr SetReadonly[Elt]) IsEmpty() bool
func (SetReadonly[Elt]) Len ¶
func (sr SetReadonly[Elt]) Len() int
func (SetReadonly[Elt]) LenIsCheap ¶
func (sr SetReadonly[Elt]) LenIsCheap() bool
func (SetReadonly[Elt]) Visit ¶
func (sr SetReadonly[Elt]) Visit(visitor func(Elt) error) error
type SetWriter ¶
SetWriter is the write aspect of a Set
func NewLoggingSetWriter ¶
func NewSetChangeProjector ¶
func NewSetChangeProjector[Whole, PartA, PartB any]( factoring Factorer[Whole, PartA, PartB], partAReceiver SetWriter[PartA], repMaker func(MapChangeReceiver[PartA, MutableSet[PartB]]) MutableMap[PartA, MutableSet[PartB]], innerSetFactory func(PartA) MutableSet[PartB], ) SetWriter[Whole]
NewSetChangeProjector transforms a receiver of PartA into a receiver of Whole, given a Factorer of Whole into PartA and PartB. This buffers the set in an index created by the given maker. The booleans returned by partAReceiver are ignored.
func NewSetChangeProjectorByHashMap ¶
func NewSetChangeProjectorByHashMap[Whole, PartA, PartB any]( factoring Factorer[Whole, PartA, PartB], partAReceiver SetWriter[PartA], hashDomainA HashDomain[PartA], hashDomainB HashDomain[PartB], ) SetWriter[Whole]
func NewSetChangeProjectorByMapMap ¶
func NewSetChangeProjectorByMapMap[Whole any, PartA, PartB comparable]( factoring Factorer[Whole, PartA, PartB], partAReceiver SetWriter[PartA], ) SetWriter[Whole]
NewSetChangeProjector transforms a receiver of PartA into a receiver of Whole, given a Factorer of Whole into PartA and PartB. This buffers the set in a MapMap used as an index. The booleans returned by partAReceiver are ignored.
func NewSetWriterFuncs ¶
func SetWriterFork ¶
SetWriterFork constructs a SetWriter that broadcasts incoming changes to the given receivers. Each change is passed on to every receiver, and combineWithAnd says whether to combine the returned values with AND (the alternative is OR).
func SetWriterReverse ¶
SetWriterReverse returns a receiver that acts in the opposite way as the given receiver. That is, Add and Remove are swapped.
func TransformSetWriter ¶
type SetWriterFuncs ¶
SetWriterFuncs puts the SetWriter stamp of approval on a pair of funcs. Either may be `nil“, in which case the corresponding SetWriter method returns `false`.
func (SetWriterFuncs[Elt]) Add ¶
func (scrf SetWriterFuncs[Elt]) Add(elt Elt) bool
func (SetWriterFuncs[Elt]) Remove ¶
func (scrf SetWriterFuncs[Elt]) Remove(elt Elt) bool
type SingleBinder ¶
type SingleBinder interface { // Transact does a collection of adds and removes. Transact(func(SingleBindingOps, UpsyncOps)) }
SingleBinder is appraised of individual bindings and unbindings, but they may come in batches. Add calls are ordered by API machinery dependencies. Remove calls are ordered by the reverse of the API machinery dependencies.
type SingleBindingOps ¶
type SingleBindingOps MappingReceiver[Triple[ExternalName, WorkloadPartID, SinglePlacement], WorkloadPartDetails]
SingleBindingOps is a receiver of downsync tuples
type SingleIndexedRelation2 ¶
type SingleIndexedRelation2[First, Second any] struct { GenericMutableIndexedSet[Pair[First, Second], First, Second, Set[Second]] }
SingleIndexedRelation2 is a 2-ary relation represented by an index on the first column. It is mutable. It is not safe for concurrent access.
func NewHashRelation2 ¶
func NewHashRelation2[First, Second any](hashDomainFirst HashDomain[First], hashDomainSecond HashDomain[Second], pairs ...Pair[First, Second]) SingleIndexedRelation2[First, Second]
NewHashRelation2 constructs a Relation2 that is represented by an index on the first column. The representation is based on HashMaps.
func NewMapRelation2 ¶
func NewMapRelation2[First, Second comparable](pairs ...Pair[First, Second]) SingleIndexedRelation2[First, Second]
NewMapRelation2 constructs a Relation2 that is represented by an index on the first column. The representation is based on golang `map`s.
func NewSingleIndexedRelation2 ¶
func NewSingleIndexedRelation2[First, Second any]( secondSetFactory func(First) MutableSet[Second], rep MutableMap[First, MutableSet[Second]], pairs ...Pair[First, Second]) SingleIndexedRelation2[First, Second]
NewSingleIndexedRelation2 constructs a SingleIndexedRelation2. The caller supplies the map implementations used in the index.
type SingleIndexedRelation3 ¶
type SingleIndexedRelation3[First, Second, Third any] struct { GenericMutableIndexedSet[Triple[First, Second, Third], First, Pair[Second, Third], GenericIndexedSet[Pair[Second, Third], Second, Third, Set[Third]]] }
SingleIndexedRelation3 is a 3-ary relation represented by one nested index that maps a First value to an index from Second to Third. It is mutable. It is not safe for concurrent access.
func NewMapRelation3 ¶
func NewMapRelation3[First, Second, Third comparable]() SingleIndexedRelation3[First, Second, Third]
type SingleIndexedRelation4 ¶
type SingleIndexedRelation4[First, Second, Third, Fourth any] struct { GenericMutableIndexedSet[Quad[First, Second, Third, Fourth], First, Triple[Second, Third, Fourth], GenericIndexedSet[Triple[Second, Third, Fourth], Second, Pair[Third, Fourth], GenericIndexedSet[Pair[Third, Fourth], Third, Fourth, Set[Fourth]]]] }
SingleIndexedRelation4 is a 4-ary relation represented by one nested index that maps a First value to an index from Second to index from Third to Fourth. It is mutable. It is not safe for concurrent access.
func NewMapRelation4 ¶
func NewMapRelation4[First, Second, Third, Fourth comparable]() SingleIndexedRelation4[First, Second, Third, Fourth]
type SinglePlacement ¶
type SinglePlacement = edgeapi.SinglePlacement
type SliceHashDomain ¶
type SliceHashDomain[Elt any] struct{ EltDomain HashDomain[Elt] }
func (SliceHashDomain[Elt]) Equal ¶
func (shd SliceHashDomain[Elt]) Equal(left, right []Elt) bool
func (SliceHashDomain[Elt]) Hash ¶
func (shd SliceHashDomain[Elt]) Hash(slice []Elt) HashValue
type SourceAndDestination ¶
type SourceAndDestination = Pair[logicalcluster.Name, SinglePlacement]
type TestAPIMapProvider ¶
TestAPIMapProvider is a funky APIMapProvider for testing purposes. It is not fully compliant regarding locking. It exposes internals for test functions to examine and manipulate. A test func can modify a cluster's GroupInfo and/or ResourceInfo and the registered receivers will be synchronously updated, but this should only be done while there is no concurrent acess going on.
func NewTestAPIMapProvider ¶
func NewTestAPIMapProvider(logger klog.Logger) *TestAPIMapProvider
func (*TestAPIMapProvider) AddReceivers ¶
func (tap *TestAPIMapProvider) AddReceivers(cluster logicalcluster.Name, groupReceiver *MappingReceiverHolder[string, APIGroupInfo], resourceReceiver *MappingReceiverHolder[metav1.GroupResource, ResourceDetails])
func (*TestAPIMapProvider) AsResourceReceiver ¶
func (tap *TestAPIMapProvider) AsResourceReceiver() MappingReceiver[Pair[logicalcluster.Name, metav1.GroupResource], ResourceDetails]
func (*TestAPIMapProvider) RemoveReceivers ¶
func (tap *TestAPIMapProvider) RemoveReceivers(cluster logicalcluster.Name, groupReceiver *MappingReceiverHolder[string, APIGroupInfo], resourceReceiver *MappingReceiverHolder[metav1.GroupResource, ResourceDetails])
type TestAPIPerCluster ¶
type TestAPIPerCluster struct { GroupInfo MutableMap[string, APIGroupInfo] ResourceInfo MutableMap[metav1.GroupResource, ResourceDetails] // contains filtered or unexported fields }
type TransactionalMappingReceiver ¶
type TransactionalMappingReceiver[Key, Val any] interface { Transact(func(MappingReceiver[Key, Val])) }
TransactionalMappingReceiver is one that takes updates in batches
type TransformHashDomain ¶
type TransformHashDomain[Original, Transformed any] struct { Transform func(Original) Transformed TransformedDomain HashDomain[Transformed] }
func (TransformHashDomain[Original, Transformed]) Equal ¶
func (thd TransformHashDomain[Original, Transformed]) Equal(left, right Original) bool
func (TransformHashDomain[Original, Transformed]) Hash ¶
func (thd TransformHashDomain[Original, Transformed]) Hash(arg Original) HashValue
type TransformMappingReceiver ¶
type TransformMappingReceiver[KeyOriginal, KeyTransformed, ValOriginal, ValTransformed any] struct { TransformKey func(KeyOriginal) KeyTransformed TransformVal func(ValOriginal) ValTransformed Inner MappingReceiver[KeyTransformed, ValTransformed] }
func (TransformMappingReceiver[KeyOriginal, KeyTransformed, ValOriginal, ValTransformed]) Delete ¶
func (xr TransformMappingReceiver[KeyOriginal, KeyTransformed, ValOriginal, ValTransformed]) Delete(keyOriginal KeyOriginal)
func (TransformMappingReceiver[KeyOriginal, KeyTransformed, ValOriginal, ValTransformed]) Put ¶
func (xr TransformMappingReceiver[KeyOriginal, KeyTransformed, ValOriginal, ValTransformed]) Put(keyOriginal KeyOriginal, valOriginal ValOriginal)
type TransformingRelayMap ¶
type TransformingRelayMap[Key comparable, OuterVal any, InnerVal any] interface { MappingReceiver[Key, OuterVal] OuterGet(Key) OuterVal DynamicMapProviderWithRelease[Key, InnerVal] Len() int Remove(Key) }
func NewRelayAndProjectMap ¶
func NewRelayAndProjectMap[Key comparable, OuterVal any, InnerVal any](dedupReceivers bool, transform func(OuterVal) InnerVal) TransformingRelayMap[Key, OuterVal, InnerVal]
type Triple ¶
type Triple[First, Second, Third any] struct { First First Second Second Third Third }
type TripleSetWriterReverse23 ¶
type TripleSetWriterReverse23[Left, Middle, Right any] struct { // contains filtered or unexported fields }
func (TripleSetWriterReverse23[Left, Middle, Right]) Add ¶
func (prr TripleSetWriterReverse23[Left, Middle, Right]) Add(tup Triple[Left, Right, Middle]) bool
func (TripleSetWriterReverse23[Left, Middle, Right]) Remove ¶
func (prr TripleSetWriterReverse23[Left, Middle, Right]) Remove(tup Triple[Left, Right, Middle]) bool
type TrivialTransactor ¶
type TrivialTransactor[OpsType any] struct{ Ops OpsType }
func (TrivialTransactor[OpsType]) Transact ¶
func (tt TrivialTransactor[OpsType]) Transact(xn func(OpsType))
type UpsyncOps ¶
type UpsyncOps SetChangeReceiver[Triple[ExternalName, edgeapi.UpsyncSet, SinglePlacement]]
UpsyncOps is a receiver of upsync tuples. Each call conveys one UpsyncSet that a particular EdgePlacement object calls for, and where it is to be upsynced from. Some day we might recognize that an UpsyncSet is a predicate and we combine predicates when one implies the other, but today is not that day. Today we simply treat each as a syntactic expression and look at syntactic equality.
type UpsyncsDifferenceConstructor ¶
type UpsyncsDifferenceConstructor = func(SetChangeReceiver[edgeapi.UpsyncSet]) Receiver[[]edgeapi.UpsyncSet]
UpsyncsDifferenceConstructor constructs a difference for slices of UpsyncSet. Note that there are two levels of "set" here: a `[]UpsyncSet` is an OR-of-ANDs expression of how to identify objects to upsync, and an `UpsyncSet` has "set" in its name because it includes some fields that are logically sets. The differencer here differences successive OR-of-ANDs expressions to deliver changes in which ANDs are present.
type Visitable ¶
type Visitable[Elt any] interface { // Visit calls the given function on every member, aborting on error Visit(func(Elt) error) error }
Visitable is a collection that can do an interruptable enumeration of its members. The collection may or may not be mutable. This view of the collection may or may not have a limited scope of validity. This view may or may not have concurrency restrictions.
func JoinByVisitSquared ¶
func MapSetAsVisitable ¶
func MapSetAsVisitable[Elt comparable](ms MapSet[Elt]) Visitable[Elt]
func ResolvedWhatAsVisitable ¶
func ResolvedWhatAsVisitable(rw WorkloadParts) Visitable[Pair[WorkloadPartID, WorkloadPartDetails]]
func ResolvedWhereAsVisitable ¶
func ResolvedWhereAsVisitable(rw ResolvedWhere) Visitable[SinglePlacement]
func TransformVisitable ¶
type VisitableStringerVal ¶
type VisitableStringerVal[Elt any] struct { // contains filtered or unexported fields }
func VisitableStringer ¶
func VisitableStringer[Elt any](set Visitable[Elt]) VisitableStringerVal[Elt]
VisitableStringer wraps a given set with particular String() behavior. NB: you only want to apply this to a set that is safe for concurrent access, and you probably only want to apply it to an immutable set.
func (VisitableStringerVal[Elt]) String ¶
func (vs VisitableStringerVal[Elt]) String() string
type WhatResolver ¶
type WhatResolver func(MappingReceiver[ExternalName, ResolvedWhat]) Runnable
WhatResolver is responsible for keeping its receiver eventually consistent with the resolution of the "what" predicate and the upsync prescription of each EdgePlacement (identified by cluster ane name).
func NewWhatResolver ¶
func NewWhatResolver( ctx context.Context, edgePlacementPreInformer edgev1alpha1informers.EdgePlacementClusterInformer, discoveryClusterClient clusterdiscovery.DiscoveryClusterInterface, crdClusterPreInformer kcpinformers.GenericClusterInformer, bindingClusterPreInformer kcpinformers.GenericClusterInformer, dynamicClusterClient clusterdynamic.ClusterInterface, numThreads int, ) WhatResolver
NewWhatResolver returns a WhatResolver; invoke that function after the namespace informer has synced.
type WhatResolverClusterHandler ¶
type WhatResolverClusterHandler struct {
// contains filtered or unexported fields
}
func (WhatResolverClusterHandler) Get ¶
func (wr WhatResolverClusterHandler) Get(placement ExternalName, kont func(WorkloadParts))
func (WhatResolverClusterHandler) OnAdd ¶
func (wrh WhatResolverClusterHandler) OnAdd(obj any)
func (WhatResolverClusterHandler) OnDelete ¶
func (wrh WhatResolverClusterHandler) OnDelete(obj any)
func (WhatResolverClusterHandler) OnUpdate ¶
func (wrh WhatResolverClusterHandler) OnUpdate(oldObj, newObj any)
type WhatResolverScopedHandler ¶
type WhatResolverScopedHandler struct {
// contains filtered or unexported fields
}
func (WhatResolverScopedHandler) Get ¶
func (wr WhatResolverScopedHandler) Get(placement ExternalName, kont func(WorkloadParts))
func (WhatResolverScopedHandler) OnAdd ¶
func (wrh WhatResolverScopedHandler) OnAdd(obj any)
func (WhatResolverScopedHandler) OnDelete ¶
func (wrh WhatResolverScopedHandler) OnDelete(obj any)
func (WhatResolverScopedHandler) OnUpdate ¶
func (wrh WhatResolverScopedHandler) OnUpdate(oldObj, newObj any)
type WhereResolver ¶
type WhereResolver func(MappingReceiver[ExternalName, ResolvedWhere]) Runnable
WhereResolver is responsible for keeping given receiver eventually consistent with the resolution of the "where" predicate for each EdgePlacement (identified by cluster and name).
func NewWhereResolver ¶
func NewWhereResolver( ctx context.Context, spsPreInformer edgev1alpha1informers.SinglePlacementSliceClusterInformer, numThreads int, ) WhereResolver
NewWhereResolver returns a WhereResolver.
type WhereResolverClusterHandler ¶
type WhereResolverClusterHandler struct {
// contains filtered or unexported fields
}
func (WhereResolverClusterHandler) AddReceiver ¶
func (wr WhereResolverClusterHandler) AddReceiver(receiver MappingReceiver[ExternalName, ResolvedWhere], notifyCurrent bool)
func (WhereResolverClusterHandler) Get ¶
func (wr WhereResolverClusterHandler) Get(placement ExternalName, kont func(ResolvedWhere))
func (WhereResolverClusterHandler) OnAdd ¶
func (wrh WhereResolverClusterHandler) OnAdd(obj any)
func (WhereResolverClusterHandler) OnDelete ¶
func (wrh WhereResolverClusterHandler) OnDelete(obj any)
func (WhereResolverClusterHandler) OnUpdate ¶
func (wrh WhereResolverClusterHandler) OnUpdate(oldObj, newObj any)
type WorkloadPartDetails ¶
type WorkloadPartDetails struct { // APIVersion is version (no group) that the source workspace prefers to serve. // In the case of a namespace object: this field only applies to the namespace // object itself, not the namespace contents, and is the empty string if // IncludeNamespaceObject is false. APIVersion string // IncludeNamespaceObject is only interesting for a Namespace part, and // indicates whether to include the details of the Namespace object; // the objects in the namespace are certainly included. // For other parts, this field holds `false`. IncludeNamespaceObject bool }
WorkloadPartDetails provides additional details about how the WorkloadPart is to be included.
type WorkloadPartID ¶
type WorkloadPartID struct { APIGroup string // Resource is the lowercase plural way of identifying the kind of object Resource string Name string }
WorkloadPartID identifies part of a workload.
func (WorkloadPartID) GroupResource ¶
func (partID WorkloadPartID) GroupResource() metav1.GroupResource
type WorkloadPartX ¶
type WorkloadPartX struct { WorkloadPartID WorkloadPartDetails }
type WorkloadParts ¶
type WorkloadParts map[WorkloadPartID]WorkloadPartDetails
WorkloadParts identifies what to downsync and provides ephemeral details for that process. A workload prescription is the things that match the "what" predicate of an EdgePlacement.
Every WorkloadParts that appears in the interfaces here is immutable.
In the case of a Namespace object, this implies that all the objects in that namespace are included.
A workload may include objects of kinds that are built into the edge cluster. By built-in we mean that these kinds are both already known (regardless of whether it is via being built into the apiserver or added to it by either form of aggregation) and not managed by edge workload management. It is the user's responsibility to make the "what" predicate match the corresponding CRD when the workload includes an object of a kind that is not built into the edge cluster.
type WorkloadProjectionSections ¶
type WorkloadProjectionSections struct { NamespaceDistributions SetWriter[NamespaceDistributionTuple] NamespacedResourceDistributions SetWriter[NamespacedResourceDistributionTuple] NamespacedModes MappingReceiver[ProjectionModeKey, ProjectionModeVal] NonNamespacedDistributions SetWriter[NonNamespacedDistributionTuple] NonNamespacedModes MappingReceiver[ProjectionModeKey, ProjectionModeVal] Upsyncs SetWriter[Pair[SinglePlacement, edgeapi.UpsyncSet]] }
WorkloadProjectionSections is given, incrementally, instructions for what goes where how, organized for consumption by syncers. The FooDistributions are proper sets, while the FooModes add dependent information for set members. The booleans returned from the SetWriters may not be meaningful.
type WorkloadProjector ¶
type WorkloadProjector interface {
Transact(func(WorkloadProjectionSections))
}
WorkloadProjector is kept appraised of what goes where and is responsible for maintaining (a) the customized workload copies in the mailbox workspaces and (b) the syncer configuration objects.
func NewLoggingWorkloadProjector ¶
func NewLoggingWorkloadProjector(logger klog.Logger) WorkloadProjector
Source Files ¶
- apiwatch-map-provider.go
- binding-organizer.go
- client-tracker.go
- declarations.go
- dummies.go
- external-name.go
- functions.go
- hash-domain.go
- join-dynamic-12vwith13.go
- join-dynamic-12with13.go
- join-static.go
- main.go
- map-constant.go
- map-factored-aggregate.go
- map-factored.go
- map-hash.go
- map-key-set.go
- map-map.go
- map-relation.go
- map-rotated-key.go
- map-set-differencer.go
- map-set.go
- map-types.go
- pipefitting.go
- relation-types.go
- relay-map.go
- set-binder-assembly.go
- set-binder-test.go
- set-hash.go
- set-indexed.go
- set-project.go
- set-types.go
- slice-differencer.go
- slices.go
- test-apimap-provider.go
- tuples.go
- what-resolver.go
- where-resolver.go
- workload-projector.go