Documentation ¶
Overview ¶
Package client is a generated GoMock package.
Index ¶
- func NewDynamicResource(client *DynamicClient) dynamic.Interface
- type Client
- type DynamicClient
- func (c *DynamicClient) Create(ns string, resource schema.GroupVersionResource, ut *unstructured.Unstructured) (*unstructured.Unstructured, error)
- func (c *DynamicClient) Delete(ns, name string, resource schema.GroupVersionResource, ...) error
- func (c *DynamicClient) Get(ns, name string, resource schema.GroupVersionResource, opts metav1.GetOptions) (*unstructured.Unstructured, error)
- func (c *DynamicClient) List(ns string, resource schema.GroupVersionResource, opts metav1.ListOptions) (*unstructured.UnstructuredList, error)
- func (c *DynamicClient) Update(ns string, resource schema.GroupVersionResource, ut *unstructured.Unstructured) (*unstructured.Unstructured, error)
- type DynamicMixResource
- type DynamicResource
- func (d *DynamicResource) Create(ctx context.Context, obj *unstructured.Unstructured, ...) (*unstructured.Unstructured, error)
- func (d *DynamicResource) Delete(ctx context.Context, name string, options metav1.DeleteOptions, ...) error
- func (d *DynamicResource) DeleteCollection(ctx context.Context, options metav1.DeleteOptions, ...) error
- func (d *DynamicResource) Get(ctx context.Context, name string, options metav1.GetOptions, ...) (*unstructured.Unstructured, error)
- func (d *DynamicResource) List(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error)
- func (d *DynamicResource) Namespace(ns string) dynamic.ResourceInterface
- func (d *DynamicResource) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, ...) (*unstructured.Unstructured, error)
- func (d *DynamicResource) Resource(resource schema.GroupVersionResource) dynamic.NamespaceableResourceInterface
- func (d *DynamicResource) Update(ctx context.Context, obj *unstructured.Unstructured, ...) (*unstructured.Unstructured, error)
- func (d *DynamicResource) UpdateStatus(ctx context.Context, obj *unstructured.Unstructured, ...) (*unstructured.Unstructured, error)
- func (d *DynamicResource) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
- type LocalClient
- func (c *LocalClient) Create(resource, ns string, object runtime.Object) (runtime.Object, error)
- func (c *LocalClient) Delete(resource, ns, name string, opts *metav1.DeleteOptions) error
- func (c *LocalClient) Get(resource, ns, name string, opts metav1.GetOptions, into runtime.Object) (runtime.Object, error)
- func (c *LocalClient) List(resource, ns string, opts metav1.ListOptions, list runtime.Object) error
- func (c *LocalClient) Register(resource, ns string, store mem.Store)
- func (c *LocalClient) Start(stopCh <-chan struct{}) error
- func (c *LocalClient) Update(resource, ns string, object runtime.Object) (runtime.Object, error)
- func (c *LocalClient) Watch(resource, ns string, opts *mem.WatchOptions) (watch.Interface, error)
- type MockClient
- func (m *MockClient) Create(resource, ns string, object runtime.Object) (runtime.Object, error)
- func (m *MockClient) Delete(resource, ns, name string, opts *v1.DeleteOptions) error
- func (m *MockClient) EXPECT() *MockClientMockRecorder
- func (m *MockClient) Get(resource, ns, name string, opts v1.GetOptions, into runtime.Object) (runtime.Object, error)
- func (m *MockClient) List(resource, ns string, opts v1.ListOptions, into runtime.Object) error
- func (m *MockClient) Start(stopCh <-chan struct{}) error
- func (m *MockClient) Update(resource, ns string, object runtime.Object) (runtime.Object, error)
- func (m *MockClient) Watch(resource, ns string, opts *mem.WatchOptions) (watch.Interface, error)
- type MockClientMockRecorder
- func (mr *MockClientMockRecorder) Create(resource, ns, object interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) Delete(resource, ns, name, opts interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) Get(resource, ns, name, opts, into interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) List(resource, ns, opts, into interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) Start(stopCh interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) Update(resource, ns, object interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) Watch(resource, ns, opts interface{}) *gomock.Call
- type MockReadClient
- type MockReadClientMockRecorder
- type ReadClient
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 ¶
func (c *DynamicClient) Create(ns string, resource schema.GroupVersionResource, ut *unstructured.Unstructured) (*unstructured.Unstructured, error)
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 ¶
func (c *DynamicClient) Get(ns, name string, resource schema.GroupVersionResource, opts metav1.GetOptions) (*unstructured.Unstructured, error)
Get gets an object.
func (*DynamicClient) List ¶
func (c *DynamicClient) List(ns string, resource schema.GroupVersionResource, opts metav1.ListOptions) (*unstructured.UnstructuredList, error)
List lists objects.
func (*DynamicClient) Update ¶
func (c *DynamicClient) Update(ns string, resource schema.GroupVersionResource, ut *unstructured.Unstructured) (*unstructured.Unstructured, error)
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 ¶
func (d *DynamicMixResource) Resource(resource schema.GroupVersionResource) dynamic.NamespaceableResourceInterface
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 ¶
func (d *DynamicResource) Create(ctx context.Context, obj *unstructured.Unstructured, options metav1.CreateOptions, subresources ...string) (*unstructured.Unstructured, error)
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 ¶
func (d *DynamicResource) List(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error)
List lists resources
func (*DynamicResource) Namespace ¶
func (d *DynamicResource) Namespace(ns string) dynamic.ResourceInterface
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 ¶
func (d *DynamicResource) Resource(resource schema.GroupVersionResource) dynamic.NamespaceableResourceInterface
Resource creates a dynamic resource interface
func (*DynamicResource) Update ¶
func (d *DynamicResource) Update(ctx context.Context, obj *unstructured.Unstructured, options metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error)
Update updates a resource
func (*DynamicResource) UpdateStatus ¶
func (d *DynamicResource) UpdateStatus(ctx context.Context, obj *unstructured.Unstructured, options metav1.UpdateOptions) (*unstructured.Unstructured, error)
UpdateStatus update status for a resource
func (*DynamicResource) Watch ¶
func (d *DynamicResource) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
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) 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) 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) 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) 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 ¶
func (m *MockReadClient) EXPECT() *MockReadClientMockRecorder
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.