client

package
v0.0.0-...-432d548 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package client is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDynamicResource

func NewDynamicResource(client *DynamicClient) dynamic.Interface

NewDynamicResource creates a dynamic.Interface

Types

type Client

type Client interface {
	ReadClient
	Start(stopCh <-chan struct{}) error
	Create(resource, ns string, object runtime.Object) (runtime.Object, error)
	Update(resource, ns string, object runtime.Object) (runtime.Object, error)
	Delete(resource, ns, name string, opts *metav1.DeleteOptions) error
	Watch(resource, ns string, opts *mem.WatchOptions) (watch.Interface, error)
}

Client is a generic client to read/write mem objects.

type DynamicClient

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

DynamicClient operates on client using *unstructured* type.

func NewDynamicClient

func NewDynamicClient(client Client, scheme *mem.ResourceScheme) *DynamicClient

NewDynamicClient create a new dynamic client.

func (*DynamicClient) Create

Create creates an object.

func (*DynamicClient) Delete

func (c *DynamicClient) Delete(ns, name string, resource schema.GroupVersionResource, opts *metav1.DeleteOptions) error

Delete deletes an object.

func (*DynamicClient) Get

Get gets an object.

func (*DynamicClient) List

List lists objects.

func (*DynamicClient) Update

Update updates an object.

type DynamicMixResource

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

DynamicMixResource mix kubernetes and mem-kube dynamic resource interface

func NewDynamicMixResource

func NewDynamicMixResource(client Client, config *rest.Config, scheme *mem.ResourceScheme, gvks []schema.GroupVersionKind) (*DynamicMixResource, error)

NewDynamicMixResource creates a new DynamicMixResource

func (*DynamicMixResource) Resource

Resource returns dynamic.NamespaceableResourceInterface by resources

type DynamicResource

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

DynamicResource dynamic interfaces compatible with client-go dynamic.Interface

func (*DynamicResource) Create

Create create a resource

func (*DynamicResource) Delete

func (d *DynamicResource) Delete(ctx context.Context, name string, options metav1.DeleteOptions, subresources ...string) error

Delete deletes a resource

func (*DynamicResource) DeleteCollection

func (d *DynamicResource) DeleteCollection(ctx context.Context, options metav1.DeleteOptions, listOptions metav1.ListOptions) error

DeleteCollection delete a collection of resources.

func (*DynamicResource) Get

func (d *DynamicResource) Get(ctx context.Context, name string, options metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error)

Get gets a resource

func (*DynamicResource) List

List lists resources

func (*DynamicResource) Namespace

Namespace creates a dynamic namespace resource interface

func (*DynamicResource) Patch

func (d *DynamicResource) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, options metav1.PatchOptions, subresources ...string) (*unstructured.Unstructured, error)

Patch patches a resource

func (*DynamicResource) Resource

Resource creates a dynamic resource interface

func (*DynamicResource) Update

Update updates a resource

func (*DynamicResource) UpdateStatus

UpdateStatus update status for a resource

func (*DynamicResource) Watch

Watch returns a watch interface for a resource

type LocalClient

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

LocalClient used in mem-kube server to operate objects locally.

func NewLocalClient

func NewLocalClient(timeout time.Duration) *LocalClient

NewLocalClient creates a new local client.

func (*LocalClient) Create

func (c *LocalClient) Create(resource, ns string, object runtime.Object) (runtime.Object, error)

Create create an object.

func (*LocalClient) Delete

func (c *LocalClient) Delete(resource, ns, name string, opts *metav1.DeleteOptions) error

Delete deletes an object. If the object has finalizers, update the delete timestamp only.

func (*LocalClient) Get

func (c *LocalClient) Get(resource, ns, name string, opts metav1.GetOptions, into runtime.Object) (runtime.Object, error)

Get gets an object. NOTE: the return value is the internal object, not deep copied.

func (*LocalClient) List

func (c *LocalClient) List(resource, ns string, opts metav1.ListOptions, list runtime.Object) error

List gets a list of objects.

func (*LocalClient) Register

func (c *LocalClient) Register(resource, ns string, store mem.Store)

Register regists a store.

func (*LocalClient) Start

func (c *LocalClient) Start(stopCh <-chan struct{}) error

Start start all stores.

func (*LocalClient) Update

func (c *LocalClient) Update(resource, ns string, object runtime.Object) (runtime.Object, error)

Update update an object.

func (*LocalClient) Watch

func (c *LocalClient) Watch(resource, ns string, opts *mem.WatchOptions) (watch.Interface, error)

Watch get a watch.Interface to watch on an object.

type MockClient

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

MockClient is a mock of Client interface.

func NewMockClient

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) Create

func (m *MockClient) Create(resource, ns string, object runtime.Object) (runtime.Object, error)

Create mocks base method.

func (*MockClient) Delete

func (m *MockClient) Delete(resource, ns, name string, opts *v1.DeleteOptions) error

Delete mocks base method.

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClient) Get

func (m *MockClient) Get(resource, ns, name string, opts v1.GetOptions, into runtime.Object) (runtime.Object, error)

Get mocks base method.

func (*MockClient) List

func (m *MockClient) List(resource, ns string, opts v1.ListOptions, into runtime.Object) error

List mocks base method.

func (*MockClient) Start

func (m *MockClient) Start(stopCh <-chan struct{}) error

Start mocks base method.

func (*MockClient) Update

func (m *MockClient) Update(resource, ns string, object runtime.Object) (runtime.Object, error)

Update mocks base method.

func (*MockClient) Watch

func (m *MockClient) Watch(resource, ns string, opts *mem.WatchOptions) (watch.Interface, error)

Watch mocks base method.

type MockClientMockRecorder

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

MockClientMockRecorder is the mock recorder for MockClient.

func (*MockClientMockRecorder) Create

func (mr *MockClientMockRecorder) Create(resource, ns, object interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockClientMockRecorder) Delete

func (mr *MockClientMockRecorder) Delete(resource, ns, name, opts interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockClientMockRecorder) Get

func (mr *MockClientMockRecorder) Get(resource, ns, name, opts, into interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockClientMockRecorder) List

func (mr *MockClientMockRecorder) List(resource, ns, opts, into interface{}) *gomock.Call

List indicates an expected call of List.

func (*MockClientMockRecorder) Start

func (mr *MockClientMockRecorder) Start(stopCh interface{}) *gomock.Call

Start indicates an expected call of Start.

func (*MockClientMockRecorder) Update

func (mr *MockClientMockRecorder) Update(resource, ns, object interface{}) *gomock.Call

Update indicates an expected call of Update.

func (*MockClientMockRecorder) Watch

func (mr *MockClientMockRecorder) Watch(resource, ns, opts interface{}) *gomock.Call

Watch indicates an expected call of Watch.

type MockReadClient

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

MockReadClient is a mock of ReadClient interface.

func NewMockReadClient

func NewMockReadClient(ctrl *gomock.Controller) *MockReadClient

NewMockReadClient creates a new mock instance.

func (*MockReadClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockReadClient) Get

func (m *MockReadClient) Get(resource, ns, name string, opts v1.GetOptions, into runtime.Object) (runtime.Object, error)

Get mocks base method.

func (*MockReadClient) List

func (m *MockReadClient) List(resource, ns string, opts v1.ListOptions, into runtime.Object) error

List mocks base method.

type MockReadClientMockRecorder

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

MockReadClientMockRecorder is the mock recorder for MockReadClient.

func (*MockReadClientMockRecorder) Get

func (mr *MockReadClientMockRecorder) Get(resource, ns, name, opts, into interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockReadClientMockRecorder) List

func (mr *MockReadClientMockRecorder) List(resource, ns, opts, into interface{}) *gomock.Call

List indicates an expected call of List.

type ReadClient

type ReadClient interface {
	List(resource, ns string, opts metav1.ListOptions, into runtime.Object) error
	Get(resource, ns, name string, opts metav1.GetOptions, into runtime.Object) (runtime.Object, error)
}

ReadClient represents a client to read a mem resource.

Jump to

Keyboard shortcuts

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