mock

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// Handler implements the required API endpoints
	Handler Handler
}

Client structure for a mocked API client

func New

func New() (client *Client)

New creates a new mocked API client

func (*Client) Add

func (client *Client) Add(namespace, name string, spec typesV1.TargetSpec)

Add test function. Creates a watcher event indicating a customer resource has been added.

func (*Client) Delete

func (client *Client) Delete(namespace, name string)

Delete test function. Creates a watcher event indicating a customer resource has been deleted.

func (*Client) Modify

func (client *Client) Modify(namespace, name string, spec typesV1.TargetSpec)

Modify test function. Creates a watcher event indicating a customer resource has been modified.

func (*Client) Targets

func (client *Client) Targets(_ string) v1.TargetCRDInterface

Targets emulates the API's Targets function. Currently, it passes through to the Handler, i.e. it does not support any namespace awareness.

type Handler

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

Handler implements the supported endpoints

func (*Handler) Watch

func (handler *Handler) Watch(_ context.Context, _ metav1.ListOptions) (watch.Interface, error)

Watch creates a watcher that will notify when a target is added/updated/deleted

Jump to

Keyboard shortcuts

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