Documentation ¶
Index ¶
- func InitScheme(t *testing.T) *runtime.Scheme
- type Action
- type CreateAction
- type FakeClient
- func (c *FakeClient) AddReactor(verb string, resource string, reaction ReactionFunc)
- func (c *FakeClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
- func (c *FakeClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error
- func (c *FakeClient) DeleteAllOf(_ context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error
- func (c *FakeClient) Get(ctx context.Context, key client.ObjectKey, obj client.Object) error
- func (c *FakeClient) List(_ context.Context, list client.ObjectList, opts ...client.ListOption) error
- func (c *FakeClient) Patch(_ context.Context, obj client.Object, patch client.Patch, ...) error
- func (c *FakeClient) RESTMapper() meta.RESTMapper
- func (c *FakeClient) Scheme() *runtime.Scheme
- func (c *FakeClient) Status() client.StatusWriter
- func (c *FakeClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
- type GetAction
- type ReactionFunc
- type Reactor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action interface { Verb() string GVR() schema.GroupVersionResource Key() client.ObjectKey }
func NewCreateAction ¶
func NewCreateAction(key client.ObjectKey, gvr schema.GroupVersionResource) Action
func NewGetAction ¶
func NewGetAction(key client.ObjectKey, gvr schema.GroupVersionResource) Action
type CreateAction ¶
type CreateAction struct {
// contains filtered or unexported fields
}
func (CreateAction) GVR ¶
func (a CreateAction) GVR() schema.GroupVersionResource
func (CreateAction) Key ¶
func (a CreateAction) Key() client.ObjectKey
func (CreateAction) Object ¶
func (a CreateAction) Object() client.Object
func (CreateAction) Verb ¶
func (a CreateAction) Verb() string
type FakeClient ¶
type FakeClient struct { // ReactionChain is the list of reactors that will be attempted for every // request in the order they are tried. ReactionChain []Reactor // contains filtered or unexported fields }
FakeClient is inspired and taken from https://github.com/kubernetes/client-go/
func NewFakeClient ¶
func NewFakeClient(scheme *runtime.Scheme, objs ...client.Object) *FakeClient
NewFakeClient returns a new fake client
func (*FakeClient) AddReactor ¶
func (c *FakeClient) AddReactor(verb string, resource string, reaction ReactionFunc)
func (*FakeClient) Create ¶
func (c *FakeClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
func (*FakeClient) Delete ¶
func (c *FakeClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error
func (*FakeClient) DeleteAllOf ¶
func (c *FakeClient) DeleteAllOf(_ context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error
func (*FakeClient) List ¶
func (c *FakeClient) List(_ context.Context, list client.ObjectList, opts ...client.ListOption) error
func (*FakeClient) Patch ¶
func (c *FakeClient) Patch(_ context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error
func (*FakeClient) RESTMapper ¶
func (c *FakeClient) RESTMapper() meta.RESTMapper
func (*FakeClient) Scheme ¶
func (c *FakeClient) Scheme() *runtime.Scheme
func (*FakeClient) Status ¶
func (c *FakeClient) Status() client.StatusWriter
func (*FakeClient) Update ¶
func (c *FakeClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
type GetAction ¶
type GetAction struct {
// contains filtered or unexported fields
}
func (GetAction) GVR ¶
func (a GetAction) GVR() schema.GroupVersionResource
type ReactionFunc ¶
ReactionFunc is a function returning `handled` set to true if no further processing is required and an error if one needs to be raised
type Reactor ¶
type Reactor interface { // Handles indicates whether or not this Reactor deals with a given // action. Handles(action Action) bool // React handles the action and returns results. It may choose to // delegate by indicated handled=false. React(action Action) (handled bool, err error) }
Reactor is an interface to allow the composition of reaction functions.
Click to show internal directories.
Click to hide internal directories.