mocks

package
v2.12.7 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminAPIClientFactory added in v2.11.0

type AdminAPIClientFactory struct {
	// contains filtered or unexported fields
}

AdminAPIClientFactory is a mock implementation of adminapi.ClientFactory.

func NewAdminAPIClientFactory added in v2.11.0

func NewAdminAPIClientFactory(errorsToReturn map[string]error) *AdminAPIClientFactory

func (*AdminAPIClientFactory) CreateAdminAPIClient added in v2.11.0

type AdminAPIDiscoverer added in v2.11.0

type AdminAPIDiscoverer struct {
	// contains filtered or unexported fields
}

AdminAPIDiscoverer is a mock implementation of adminapi.Discoverer.

func NewAdminAPIDiscoverer added in v2.11.0

func NewAdminAPIDiscoverer(apisToReturn sets.Set[adminapi.DiscoveredAdminAPI], errToReturn error) *AdminAPIDiscoverer

func (*AdminAPIDiscoverer) AdminAPIsFromEndpointSlice added in v2.11.0

func (m *AdminAPIDiscoverer) AdminAPIsFromEndpointSlice(discoveryv1.EndpointSlice) (
	sets.Set[adminapi.DiscoveredAdminAPI],
	error,
)

func (*AdminAPIDiscoverer) AdminAPIsFromEndpointSliceCalledTimes added in v2.11.0

func (m *AdminAPIDiscoverer) AdminAPIsFromEndpointSliceCalledTimes() int

func (*AdminAPIDiscoverer) GetAdminAPIsForService added in v2.11.0

func (*AdminAPIDiscoverer) GetAdminAPIsForServiceCalledTimes added in v2.11.0

func (m *AdminAPIDiscoverer) GetAdminAPIsForServiceCalledTimes() int

type AdminAPIHandler added in v2.11.0

type AdminAPIHandler struct {
	// contains filtered or unexported fields
}

AdminAPIHandler is a mock implementation of the Admin API. It only implements the endpoints that are required for the tests.

func NewAdminAPIHandler added in v2.11.0

func NewAdminAPIHandler(t *testing.T, opts ...AdminAPIHandlerOpt) *AdminAPIHandler

func (*AdminAPIHandler) ServeHTTP added in v2.11.0

func (m *AdminAPIHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*AdminAPIHandler) WasWorkspaceCreated added in v2.11.0

func (m *AdminAPIHandler) WasWorkspaceCreated() bool

type AdminAPIHandlerOpt added in v2.11.0

type AdminAPIHandlerOpt func(h *AdminAPIHandler)

func WithConfigurationHash added in v2.12.0

func WithConfigurationHash(hash string) AdminAPIHandlerOpt

func WithReady added in v2.11.0

func WithReady(ready bool) AdminAPIHandlerOpt

func WithWorkspaceExists added in v2.11.0

func WithWorkspaceExists(exists bool) AdminAPIHandlerOpt

type Dataplane added in v2.11.0

type Dataplane struct {
	KubernetesObjectReportsEnabled bool
	// Mapping namespace to name to status
	// Note: this will come in useful when implementing
	// https://github.com/Kong/kubernetes-ingress-controller/issues/3793
	// which requires the status to be reported for route objects.
	ObjectsStatuses map[string]map[string]k8sobj.ConfigurationStatus
}

func (Dataplane) AreKubernetesObjectReportsEnabled added in v2.11.0

func (d Dataplane) AreKubernetesObjectReportsEnabled() bool

func (Dataplane) DeleteObject added in v2.11.0

func (d Dataplane) DeleteObject(_ client.Object) error

func (Dataplane) KubernetesObjectConfigurationStatus added in v2.11.0

func (d Dataplane) KubernetesObjectConfigurationStatus(obj client.Object) k8sobj.ConfigurationStatus

func (Dataplane) KubernetesObjectIsConfigured added in v2.11.0

func (d Dataplane) KubernetesObjectIsConfigured(obj client.Object) bool

func (Dataplane) Listeners added in v2.11.0

func (Dataplane) ObjectExists added in v2.11.0

func (d Dataplane) ObjectExists(obj client.Object) (bool, error)

func (Dataplane) UpdateObject added in v2.11.0

func (d Dataplane) UpdateObject(_ client.Object) error

type EventRecorder added in v2.11.0

type EventRecorder struct {
	// contains filtered or unexported fields
}

EventRecorder is a mock implementation of the k8s.io/client-go/tools/record.EventRecorder interface.

func NewEventRecorder added in v2.11.0

func NewEventRecorder() *EventRecorder

func (*EventRecorder) AnnotatedEventf added in v2.11.0

func (r *EventRecorder) AnnotatedEventf(_ runtime.Object, _ map[string]string, eventtype, reason, messageFmt string, args ...interface{})

func (*EventRecorder) Event added in v2.11.0

func (r *EventRecorder) Event(_ runtime.Object, eventtype, reason, message string)

func (*EventRecorder) Eventf added in v2.11.0

func (r *EventRecorder) Eventf(_ runtime.Object, eventtype, reason, messageFmt string, args ...interface{})

func (*EventRecorder) Events added in v2.11.0

func (r *EventRecorder) Events() []string

type Ticker

type Ticker struct {
	// contains filtered or unexported fields
}

func NewTicker

func NewTicker() *Ticker

func (*Ticker) Add

func (t *Ticker) Add(d time.Duration)

func (*Ticker) Channel

func (t *Ticker) Channel() <-chan time.Time

func (*Ticker) Now

func (t *Ticker) Now() time.Time

func (*Ticker) Reset

func (t *Ticker) Reset(d time.Duration)

func (*Ticker) Stop

func (t *Ticker) Stop()

Jump to

Keyboard shortcuts

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