client

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SigsClientInterface

type SigsClientInterface interface {
	k8sclient.Reader
	k8sclient.Writer
	k8sclient.StatusClient
	GetSigsClient() k8sclient.Client
}

type SigsClientInterfaceMock

type SigsClientInterfaceMock struct {
	// CreateFunc mocks the Create method.
	CreateFunc func(ctx context.Context, obj runtime.Object, opts ...client.CreateOption) error

	// DeleteFunc mocks the Delete method.
	DeleteFunc func(ctx context.Context, obj runtime.Object, opts ...client.DeleteOption) error

	// DeleteAllOfFunc mocks the DeleteAllOf method.
	DeleteAllOfFunc func(ctx context.Context, obj runtime.Object, opts ...client.DeleteAllOfOption) error

	// GetFunc mocks the Get method.
	GetFunc func(ctx context.Context, key types.NamespacedName, obj runtime.Object) error

	// GetSigsClientFunc mocks the GetSigsClient method.
	GetSigsClientFunc func() client.Client

	// ListFunc mocks the List method.
	ListFunc func(ctx context.Context, list runtime.Object, opts ...client.ListOption) error

	// PatchFunc mocks the Patch method.
	PatchFunc func(ctx context.Context, obj runtime.Object, patch client.Patch, opts ...client.PatchOption) error

	// StatusFunc mocks the Status method.
	StatusFunc func() client.StatusWriter

	// UpdateFunc mocks the Update method.
	UpdateFunc func(ctx context.Context, obj runtime.Object, opts ...client.UpdateOption) error
	// contains filtered or unexported fields
}

SigsClientInterfaceMock is a mock implementation of SigsClientInterface.

    func TestSomethingThatUsesSigsClientInterface(t *testing.T) {

        // make and configure a mocked SigsClientInterface
        mockedSigsClientInterface := &SigsClientInterfaceMock{
            CreateFunc: func(ctx context.Context, obj runtime.Object, opts ...client.CreateOption) error {
	               panic("mock out the Create method")
            },
            DeleteFunc: func(ctx context.Context, obj runtime.Object, opts ...client.DeleteOption) error {
	               panic("mock out the Delete method")
            },
            DeleteAllOfFunc: func(ctx context.Context, obj runtime.Object, opts ...client.DeleteAllOfOption) error {
	               panic("mock out the DeleteAllOf method")
            },
            GetFunc: func(ctx context.Context, key types.NamespacedName, obj runtime.Object) error {
	               panic("mock out the Get method")
            },
            GetSigsClientFunc: func() client.Client {
	               panic("mock out the GetSigsClient method")
            },
            ListFunc: func(ctx context.Context, list runtime.Object, opts ...client.ListOption) error {
	               panic("mock out the List method")
            },
            PatchFunc: func(ctx context.Context, obj runtime.Object, patch client.Patch, opts ...client.PatchOption) error {
	               panic("mock out the Patch method")
            },
            StatusFunc: func() client.StatusWriter {
	               panic("mock out the Status method")
            },
            UpdateFunc: func(ctx context.Context, obj runtime.Object, opts ...client.UpdateOption) error {
	               panic("mock out the Update method")
            },
        }

        // use mockedSigsClientInterface in code that requires SigsClientInterface
        // and then make assertions.

    }

func NewSigsClientMoqWithScheme

func NewSigsClientMoqWithScheme(clientScheme *runtime.Scheme, initObjs ...runtime.Object) *SigsClientInterfaceMock

func (*SigsClientInterfaceMock) Create

Create calls CreateFunc.

func (*SigsClientInterfaceMock) CreateCalls

func (mock *SigsClientInterfaceMock) CreateCalls() []struct {
	Ctx  context.Context
	Obj  runtime.Object
	Opts []client.CreateOption
}

CreateCalls gets all the calls that were made to Create. Check the length with:

len(mockedSigsClientInterface.CreateCalls())

func (*SigsClientInterfaceMock) Delete

Delete calls DeleteFunc.

func (*SigsClientInterfaceMock) DeleteAllOf

func (mock *SigsClientInterfaceMock) DeleteAllOf(ctx context.Context, obj runtime.Object, opts ...client.DeleteAllOfOption) error

DeleteAllOf calls DeleteAllOfFunc.

func (*SigsClientInterfaceMock) DeleteAllOfCalls

func (mock *SigsClientInterfaceMock) DeleteAllOfCalls() []struct {
	Ctx  context.Context
	Obj  runtime.Object
	Opts []client.DeleteAllOfOption
}

DeleteAllOfCalls gets all the calls that were made to DeleteAllOf. Check the length with:

len(mockedSigsClientInterface.DeleteAllOfCalls())

func (*SigsClientInterfaceMock) DeleteCalls

func (mock *SigsClientInterfaceMock) DeleteCalls() []struct {
	Ctx  context.Context
	Obj  runtime.Object
	Opts []client.DeleteOption
}

DeleteCalls gets all the calls that were made to Delete. Check the length with:

len(mockedSigsClientInterface.DeleteCalls())

func (*SigsClientInterfaceMock) Get

Get calls GetFunc.

func (*SigsClientInterfaceMock) GetCalls

func (mock *SigsClientInterfaceMock) GetCalls() []struct {
	Ctx context.Context
	Key types.NamespacedName
	Obj runtime.Object
}

GetCalls gets all the calls that were made to Get. Check the length with:

len(mockedSigsClientInterface.GetCalls())

func (*SigsClientInterfaceMock) GetSigsClient

func (mock *SigsClientInterfaceMock) GetSigsClient() client.Client

GetSigsClient calls GetSigsClientFunc.

func (*SigsClientInterfaceMock) GetSigsClientCalls

func (mock *SigsClientInterfaceMock) GetSigsClientCalls() []struct {
}

GetSigsClientCalls gets all the calls that were made to GetSigsClient. Check the length with:

len(mockedSigsClientInterface.GetSigsClientCalls())

func (*SigsClientInterfaceMock) List

List calls ListFunc.

func (*SigsClientInterfaceMock) ListCalls

func (mock *SigsClientInterfaceMock) ListCalls() []struct {
	Ctx  context.Context
	List runtime.Object
	Opts []client.ListOption
}

ListCalls gets all the calls that were made to List. Check the length with:

len(mockedSigsClientInterface.ListCalls())

func (*SigsClientInterfaceMock) Patch

func (mock *SigsClientInterfaceMock) Patch(ctx context.Context, obj runtime.Object, patch client.Patch, opts ...client.PatchOption) error

Patch calls PatchFunc.

func (*SigsClientInterfaceMock) PatchCalls

func (mock *SigsClientInterfaceMock) PatchCalls() []struct {
	Ctx   context.Context
	Obj   runtime.Object
	Patch client.Patch
	Opts  []client.PatchOption
}

PatchCalls gets all the calls that were made to Patch. Check the length with:

len(mockedSigsClientInterface.PatchCalls())

func (*SigsClientInterfaceMock) Status

Status calls StatusFunc.

func (*SigsClientInterfaceMock) StatusCalls

func (mock *SigsClientInterfaceMock) StatusCalls() []struct {
}

StatusCalls gets all the calls that were made to Status. Check the length with:

len(mockedSigsClientInterface.StatusCalls())

func (*SigsClientInterfaceMock) Update

Update calls UpdateFunc.

func (*SigsClientInterfaceMock) UpdateCalls

func (mock *SigsClientInterfaceMock) UpdateCalls() []struct {
	Ctx  context.Context
	Obj  runtime.Object
	Opts []client.UpdateOption
}

UpdateCalls gets all the calls that were made to Update. Check the length with:

len(mockedSigsClientInterface.UpdateCalls())

Jump to

Keyboard shortcuts

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