testing

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 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 FakeClient

type FakeClient struct {
	GetFn                func(ctx context.Context, call int, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error
	CreateFn             func(ctx context.Context, call int, obj client.Object, opts ...client.CreateOption) error
	UpdateFn             func(ctx context.Context, call int, obj client.Object, opts ...client.UpdateOption) error
	DeleteFn             func(ctx context.Context, call int, obj client.Object, opts ...client.DeleteOption) error
	ListFn               func(ctx context.Context, call int, list client.ObjectList, opts ...client.ListOption) error
	PatchFn              func(ctx context.Context, call int, obj client.Object, patch client.Patch, opts ...client.PatchOption) error
	IsObjectNamespacedFn func(call int, obj runtime.Object) (bool, error)
	RESTMapperFn         func(call int) meta.RESTMapper
	// contains filtered or unexported fields
}

TODO: not thread safe

func (*FakeClient) Create

func (c *FakeClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error

func (*FakeClient) Delete

func (c *FakeClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error

func (*FakeClient) Get

func (c *FakeClient) Get(ctx context.Context, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error

func (*FakeClient) IsObjectNamespaced

func (c *FakeClient) IsObjectNamespaced(obj runtime.Object) (bool, error)

func (*FakeClient) List

func (c *FakeClient) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error

func (*FakeClient) NumCalls

func (c *FakeClient) NumCalls() int

func (*FakeClient) Patch

func (c *FakeClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error

func (*FakeClient) RESTMapper added in v0.1.3

func (c *FakeClient) RESTMapper() meta.RESTMapper

func (*FakeClient) Update added in v0.1.9

func (c *FakeClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error

Jump to

Keyboard shortcuts

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