Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
NewClient returns a new interceptor client that calls the functions in funcs instead of the underlying client's methods, if they are not nil.
func NewSubResourceClient ¶
func NewSubResourceClient(interceptedClient client.SubResourceClient, funcs SubResourceFuncs) client.SubResourceClient
NewSubResourceClient returns a SubResourceClient that intercepts calls to the provided client with the provided functions.
Types ¶
type Funcs ¶
type Funcs struct { Get func(ctx context.Context, client client.WithWatch, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error List func(ctx context.Context, client client.WithWatch, list client.ObjectList, opts ...client.ListOption) error Create func(ctx context.Context, client client.WithWatch, obj client.Object, opts ...client.CreateOption) error Delete func(ctx context.Context, client client.WithWatch, obj client.Object, opts ...client.DeleteOption) error DeleteAllOf func(ctx context.Context, client client.WithWatch, obj client.Object, opts ...client.DeleteAllOfOption) error Update func(ctx context.Context, client client.WithWatch, obj client.Object, opts ...client.UpdateOption) error Patch func(ctx context.Context, client client.WithWatch, obj client.Object, patch client.Patch, opts ...client.PatchOption) error Watch func(ctx context.Context, client client.WithWatch, obj client.ObjectList, opts ...client.ListOption) (watch.Interface, error) SubResource func(client client.WithWatch, subResource string) client.SubResourceClient }
Funcs contains functions that are called instead of the underlying client's methods.
type SubResourceFuncs ¶
type SubResourceFuncs struct { Get func(ctx context.Context, client client.SubResourceClient, obj client.Object, subResource client.Object, opts ...client.SubResourceGetOption) error Create func(ctx context.Context, client client.SubResourceClient, obj client.Object, subResource client.Object, opts ...client.SubResourceCreateOption) error Update func(ctx context.Context, client client.SubResourceClient, obj client.Object, opts ...client.SubResourceUpdateOption) error Patch func(ctx context.Context, client client.SubResourceClient, obj client.Object, patch client.Patch, opts ...client.SubResourcePatchOption) error }
SubResourceFuncs is a set of functions that can be used to intercept calls to a SubResourceClient.
Click to show internal directories.
Click to hide internal directories.