Documentation ¶
Index ¶
- type Client
- func (c *Client[T]) Create(ctx context.Context, obj T, opts metav1.CreateOptions) (T, error)
- func (c *Client[T]) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
- func (c *Client[T]) Get(ctx context.Context, name string, options metav1.GetOptions) (T, error)
- func (c *Client[T]) GetClient() rest.Interface
- func (c *Client[T]) GetNamespace() string
- func (c *Client[T]) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, ...) (T, error)
- func (c *Client[T]) Update(ctx context.Context, obj T, opts metav1.UpdateOptions) (T, error)
- func (c *Client[T]) UpdateStatus(ctx context.Context, obj T, opts metav1.UpdateOptions) (T, error)
- func (c *Client[T]) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
- type ClientWithApply
- type ClientWithList
- type ClientWithListAndApply
- func (a *ClientWithListAndApply) Apply(ctx context.Context, obj C, opts metav1.ApplyOptions) (T, error)
- func (a *ClientWithListAndApply) ApplyStatus(ctx context.Context, obj C, opts metav1.ApplyOptions) (T, error)
- func (l *ClientWithListAndApply) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
- func (l *ClientWithListAndApply) List(ctx context.Context, opts metav1.ListOptions) (L, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client[T objectWithMeta] struct {
// contains filtered or unexported fields
}
Client represents a client, optionally namespaced, with no support for lists or apply declarative configurations.
func NewClient ¶
func NewClient[T objectWithMeta]( resource string, client rest.Interface, parameterCodec runtime.ParameterCodec, namespace string, emptyObjectCreator func() T, ) *Client[T]
NewClient constructs a client, namespaced or not, with no support for lists or apply. Non-namespaced clients are constructed by passing an empty namespace ("").
func (*Client[T]) Create ¶
Create takes the representation of a resource and creates it. Returns the server's representation of the resource, and an error, if there is any.
func (*Client[T]) Delete ¶
Delete takes name of the resource and deletes it. Returns an error if one occurs.
func (*Client[T]) Get ¶
Get takes name of the resource, and returns the corresponding object, and an error if there is any.
func (*Client[T]) GetNamespace ¶
GetNamespace returns the client's namespace, if any.
func (*Client[T]) Patch ¶
func (c *Client[T]) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (T, error)
Patch applies the patch and returns the patched resource.
func (*Client[T]) Update ¶
Update takes the representation of a resource and updates it. Returns the server's representation of the resource, and an error, if there is any.
func (*Client[T]) UpdateStatus ¶
UpdateStatus updates the status subresource of a resource. Returns the server's representation of the resource, and an error, if there is any.
type ClientWithApply ¶
type ClientWithApply[T objectWithMeta, C namedObject] struct { *Client[T] // contains filtered or unexported fields }
ClientWithApply represents a client with support for apply declarative configurations.
func NewClientWithApply ¶
func NewClientWithApply[T objectWithMeta, C namedObject]( resource string, client rest.Interface, parameterCodec runtime.ParameterCodec, namespace string, emptyObjectCreator func() T, ) *ClientWithApply[T, C]
NewClientWithApply constructs a namespaced client with support for apply declarative configurations.
func (*ClientWithApply) Apply ¶
func (a *ClientWithApply) Apply(ctx context.Context, obj C, opts metav1.ApplyOptions) (T, error)
Apply takes the given apply declarative configuration, applies it and returns the applied resource.
func (*ClientWithApply) ApplyStatus ¶
func (a *ClientWithApply) ApplyStatus(ctx context.Context, obj C, opts metav1.ApplyOptions) (T, error)
Apply takes the given apply declarative configuration, applies it to the status subresource and returns the applied resource.
type ClientWithList ¶
type ClientWithList[T objectWithMeta, L runtime.Object] struct { *Client[T] // contains filtered or unexported fields }
ClientWithList represents a client with support for lists.
func NewClientWithList ¶
func NewClientWithList[T objectWithMeta, L runtime.Object]( resource string, client rest.Interface, parameterCodec runtime.ParameterCodec, namespace string, emptyObjectCreator func() T, emptyListCreator func() L, ) *ClientWithList[T, L]
NewClientWithList constructs a namespaced client with support for lists.
func (*ClientWithList) DeleteCollection ¶
func (l *ClientWithList) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
DeleteCollection deletes a collection of objects.
type ClientWithListAndApply ¶
type ClientWithListAndApply[T objectWithMeta, L runtime.Object, C namedObject] struct { *Client[T] // contains filtered or unexported fields }
ClientWithListAndApply represents a client with support for lists and apply declarative configurations.
func NewClientWithListAndApply ¶
func NewClientWithListAndApply[T objectWithMeta, L runtime.Object, C namedObject]( resource string, client rest.Interface, parameterCodec runtime.ParameterCodec, namespace string, emptyObjectCreator func() T, emptyListCreator func() L, ) *ClientWithListAndApply[T, L, C]
NewClientWithListAndApply constructs a client with support for lists and applying declarative configurations.
func (*ClientWithListAndApply) Apply ¶
func (a *ClientWithListAndApply) Apply(ctx context.Context, obj C, opts metav1.ApplyOptions) (T, error)
Apply takes the given apply declarative configuration, applies it and returns the applied resource.
func (*ClientWithListAndApply) ApplyStatus ¶
func (a *ClientWithListAndApply) ApplyStatus(ctx context.Context, obj C, opts metav1.ApplyOptions) (T, error)
Apply takes the given apply declarative configuration, applies it to the status subresource and returns the applied resource.
func (*ClientWithListAndApply) DeleteCollection ¶
func (l *ClientWithListAndApply) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
DeleteCollection deletes a collection of objects.