k8s_crd

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: Apache-2.0 Imports: 12 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 {
	// contains filtered or unexported fields
}

func NewK8sCRDClient

func NewK8sCRDClient(groupName, groupVersion, namespace string, handlers ...ListenerHandler) (*Client, error)

NewK8sCRDClient create an K8sCRD client, for target CRD objects: @objects with given @groupname, @groupVersion, @namespace list and watchFunction would be called by k8s informer

func (*Client) WatchResources

func (c *Client) WatchResources() []cache.Store

WatchResources can only be called once

type ListenerHandler

type ListenerHandler interface {
	AddFunc(obj interface{})
	UpdateFunc(oldObj interface{}, newObj interface{})
	DeleteFunc(obj interface{})
	Watch(opts v1.ListOptions, restClient *rest.RESTClient, ns string) (watch.Interface, error)
	List(opts v1.ListOptions, restClient *rest.RESTClient, ns string) (runtime.Object, error)
	GetObject() runtime.Object
}

nolint

Jump to

Keyboard shortcuts

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