Documentation
¶
Index ¶
- type AdminAPIClientFactory
- type AdminAPIDiscoverer
- func (m *AdminAPIDiscoverer) AdminAPIsFromEndpointSlice(discoveryv1.EndpointSlice) (sets.Set[adminapi.DiscoveredAdminAPI], error)
- func (m *AdminAPIDiscoverer) AdminAPIsFromEndpointSliceCalledTimes() int
- func (m *AdminAPIDiscoverer) GetAdminAPIsForService(context.Context, client.Client, k8stypes.NamespacedName) (sets.Set[adminapi.DiscoveredAdminAPI], error)
- func (m *AdminAPIDiscoverer) GetAdminAPIsForServiceCalledTimes() int
- type AdminAPIHandler
- type AdminAPIHandlerOpt
- func WithConfigPostError(errorbody []byte) AdminAPIHandlerOpt
- func WithConfigPostErrorOnlyOnFirstRequest() AdminAPIHandlerOpt
- func WithConfigurationHash(hash string) AdminAPIHandlerOpt
- func WithReady(ready bool) AdminAPIHandlerOpt
- func WithRoot(response []byte) AdminAPIHandlerOpt
- func WithVersion(version string) AdminAPIHandlerOpt
- func WithWorkspaceExists(exists bool) AdminAPIHandlerOpt
- type Dataplane
- func (d Dataplane) AreKubernetesObjectReportsEnabled() bool
- func (d Dataplane) DeleteObject(_ client.Object) error
- func (d Dataplane) KubernetesObjectConfigurationStatus(obj client.Object) k8sobj.ConfigurationStatus
- func (d Dataplane) KubernetesObjectIsConfigured(obj client.Object) bool
- func (d Dataplane) Listeners(context.Context) ([]kong.ProxyListener, []kong.StreamListener, error)
- func (d Dataplane) ObjectExists(obj client.Object) (bool, error)
- func (d Dataplane) UpdateObject(_ client.Object) error
- type EventRecorder
- func (r *EventRecorder) AnnotatedEventf(o runtime.Object, _ map[string]string, eventtype, reason, messageFmt string, ...)
- func (r *EventRecorder) Event(o runtime.Object, eventtype, reason, message string)
- func (r *EventRecorder) Eventf(o runtime.Object, eventtype, reason, messageFmt string, args ...interface{})
- func (r *EventRecorder) Events() []string
- type StaticUUIDGenerator
- type Ticker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminAPIClientFactory ¶
type AdminAPIClientFactory struct {
// contains filtered or unexported fields
}
AdminAPIClientFactory is a mock implementation of adminapi.ClientFactory.
func NewAdminAPIClientFactory ¶
func NewAdminAPIClientFactory(errorsToReturn map[string]error) *AdminAPIClientFactory
func (*AdminAPIClientFactory) CreateAdminAPIClient ¶
func (m *AdminAPIClientFactory) CreateAdminAPIClient(_ context.Context, api adminapi.DiscoveredAdminAPI) (*adminapi.Client, error)
type AdminAPIDiscoverer ¶
type AdminAPIDiscoverer struct {
// contains filtered or unexported fields
}
AdminAPIDiscoverer is a mock implementation of adminapi.Discoverer.
func NewAdminAPIDiscoverer ¶
func NewAdminAPIDiscoverer(apisToReturn sets.Set[adminapi.DiscoveredAdminAPI], errToReturn error) *AdminAPIDiscoverer
func (*AdminAPIDiscoverer) AdminAPIsFromEndpointSlice ¶
func (m *AdminAPIDiscoverer) AdminAPIsFromEndpointSlice(discoveryv1.EndpointSlice) ( sets.Set[adminapi.DiscoveredAdminAPI], error, )
func (*AdminAPIDiscoverer) AdminAPIsFromEndpointSliceCalledTimes ¶
func (m *AdminAPIDiscoverer) AdminAPIsFromEndpointSliceCalledTimes() int
func (*AdminAPIDiscoverer) GetAdminAPIsForService ¶
func (m *AdminAPIDiscoverer) GetAdminAPIsForService(context.Context, client.Client, k8stypes.NamespacedName) ( sets.Set[adminapi.DiscoveredAdminAPI], error, )
func (*AdminAPIDiscoverer) GetAdminAPIsForServiceCalledTimes ¶
func (m *AdminAPIDiscoverer) GetAdminAPIsForServiceCalledTimes() int
type AdminAPIHandler ¶
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 ¶
func NewAdminAPIHandler(t *testing.T, opts ...AdminAPIHandlerOpt) *AdminAPIHandler
func (*AdminAPIHandler) ServeHTTP ¶
func (m *AdminAPIHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*AdminAPIHandler) WasWorkspaceCreated ¶
func (m *AdminAPIHandler) WasWorkspaceCreated() bool
type AdminAPIHandlerOpt ¶
type AdminAPIHandlerOpt func(h *AdminAPIHandler)
func WithConfigPostError ¶
func WithConfigPostError(errorbody []byte) AdminAPIHandlerOpt
func WithConfigPostErrorOnlyOnFirstRequest ¶ added in v3.2.0
func WithConfigPostErrorOnlyOnFirstRequest() AdminAPIHandlerOpt
func WithConfigurationHash ¶
func WithConfigurationHash(hash string) AdminAPIHandlerOpt
func WithReady ¶
func WithReady(ready bool) AdminAPIHandlerOpt
func WithRoot ¶ added in v3.2.0
func WithRoot(response []byte) AdminAPIHandlerOpt
func WithVersion ¶
func WithVersion(version string) AdminAPIHandlerOpt
WithVersion sets the version string returned by mocked Kong instance. If version is empty, the default version is used.
func WithWorkspaceExists ¶
func WithWorkspaceExists(exists bool) AdminAPIHandlerOpt
type Dataplane ¶
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 ¶
func (Dataplane) KubernetesObjectConfigurationStatus ¶
func (d Dataplane) KubernetesObjectConfigurationStatus(obj client.Object) k8sobj.ConfigurationStatus
func (Dataplane) KubernetesObjectIsConfigured ¶
func (Dataplane) Listeners ¶
func (d Dataplane) Listeners(context.Context) ([]kong.ProxyListener, []kong.StreamListener, error)
type EventRecorder ¶
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 ¶
func NewEventRecorder() *EventRecorder
func (*EventRecorder) AnnotatedEventf ¶
func (*EventRecorder) Event ¶
func (r *EventRecorder) Event(o runtime.Object, eventtype, reason, message string)
func (*EventRecorder) Eventf ¶
func (r *EventRecorder) Eventf(o runtime.Object, eventtype, reason, messageFmt string, args ...interface{})
func (*EventRecorder) Events ¶
func (r *EventRecorder) Events() []string
type StaticUUIDGenerator ¶ added in v3.1.5
type StaticUUIDGenerator struct {
UUID string
}
func (StaticUUIDGenerator) NewString ¶ added in v3.1.5
func (s StaticUUIDGenerator) NewString() string
Click to show internal directories.
Click to hide internal directories.