testing

package
v2.11.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeResourceTracker

type FakeResourceTracker[TObj kubernetes.Object] struct {
	sync.RWMutex

	Resources        []TObj
	IndexedResources map[ResourceTrackerIndexKey][]TObj

	AddedResourceHandlerClients   map[chan TObj]bool
	DeletedResourceHandlerClients map[chan resourceTracker.TrackerDeleteResource[TObj]]bool
	UpdatedResourceHandlerClients map[chan struct{ Old, New TObj }]bool
}

func CreateFakeResourceTracker

func CreateFakeResourceTracker[TObj kubernetes.Object](known []TObj, indexed map[ResourceTrackerIndexKey][]TObj) *FakeResourceTracker[TObj]

func (*FakeResourceTracker[TObj]) KnownResources

func (f *FakeResourceTracker[TObj]) KnownResources() ([]TObj, error)

func (*FakeResourceTracker[TObj]) KnownResourcesByIndex

func (f *FakeResourceTracker[TObj]) KnownResourcesByIndex(indexName string, indexValue string) ([]TObj, error)

func (*FakeResourceTracker[TObj]) PublishAbnormalDeleteResource

func (f *FakeResourceTracker[TObj]) PublishAbnormalDeleteResource(res TObj, rawRes interface{}, resKey string)

func (*FakeResourceTracker[TObj]) PublishAddResource

func (f *FakeResourceTracker[TObj]) PublishAddResource(res TObj)

func (*FakeResourceTracker[TObj]) PublishDeleteResource

func (f *FakeResourceTracker[TObj]) PublishDeleteResource(res TObj)

func (*FakeResourceTracker[TObj]) PublishUpdateResource

func (f *FakeResourceTracker[TObj]) PublishUpdateResource(old, new TObj)

func (*FakeResourceTracker[TObj]) RegisterAddedResourceChannel added in v2.10.0

func (f *FakeResourceTracker[TObj]) RegisterAddedResourceChannel(client chan TObj)

func (*FakeResourceTracker[TObj]) RegisterDeletedResourceChannel added in v2.10.0

func (f *FakeResourceTracker[TObj]) RegisterDeletedResourceChannel(objs chan resourceTracker.TrackerDeleteResource[TObj])

func (*FakeResourceTracker[TObj]) RegisterUpdatedResourceChannel added in v2.10.0

func (f *FakeResourceTracker[TObj]) RegisterUpdatedResourceChannel(objs chan struct{ Old, New TObj })

func (*FakeResourceTracker[TObj]) UnregisterAddedResourceChannel added in v2.10.0

func (f *FakeResourceTracker[TObj]) UnregisterAddedResourceChannel(objs chan TObj)

func (*FakeResourceTracker[TObj]) UnregisterDeletedResourceChannel added in v2.10.0

func (f *FakeResourceTracker[TObj]) UnregisterDeletedResourceChannel(objs chan resourceTracker.TrackerDeleteResource[TObj])

func (*FakeResourceTracker[TObj]) UnregisterUpdatedResourceChannel added in v2.10.0

func (f *FakeResourceTracker[TObj]) UnregisterUpdatedResourceChannel(objs chan struct{ Old, New TObj })

type ResourceTrackerIndexKey

type ResourceTrackerIndexKey struct {
	IndexName, IndexValue string
}

Jump to

Keyboard shortcuts

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