clients

package
v0.24.3 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 4 Imported by: 203

Documentation

Index

Constants

View Source
const DefaultNamespace = "default"

Variables

View Source
var DefaultRefreshRate = time.Second * 30

Functions

func DefaultNamespaceIfEmpty

func DefaultNamespaceIfEmpty(namespace string) string

Types

type DeleteOpts

type DeleteOpts struct {
	Ctx            context.Context
	IgnoreNotExist bool
	Cluster        string
}

func (DeleteOpts) WithDefaults

func (o DeleteOpts) WithDefaults() DeleteOpts

type ListOpts

type ListOpts struct {
	Ctx     context.Context
	Cluster string

	// Equality-based label requirements
	// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#equality-based-requirement
	// Equality-based requirements allow filtering by label keys and values.
	// Matching objects must satisfy all of the specified label constraints,
	// though they may have additional labels as well.
	// Example:
	//	{product: edge} would return all objects with a label key equal to
	//	product and label value equal to edge
	// If both ExpressionSelector and Selector are defined, ExpressionSelector is preferred
	Selector map[string]string
	// Set-based label requirements
	// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#set-based-requirement
	// Set-based label requirements allow filtering keys according to a set of values.
	// Three kinds of operators are supported: in,notin and exists (only the key identifier).
	// Set-based requirements can be mixed with equality-based requirements.
	// Example:
	//	"product in (edge, mesh),version=v1" would return all objects that match ALL of the following:
	//	 (1) the label key equal to product and value equal to edge or mesh
	//	 (2) the label key equal to version and the value equal to v1
	// If both ExpressionSelector and Selector are defined, ExpressionSelector is preferred
	ExpressionSelector string
}

func (ListOpts) WithDefaults

func (o ListOpts) WithDefaults() ListOpts

type ReadOpts

type ReadOpts struct {
	Ctx     context.Context
	Cluster string
}

func (ReadOpts) WithDefaults

func (o ReadOpts) WithDefaults() ReadOpts

type ResourceClient

type ResourceClient interface {
	Kind() string
	NewResource() resources.Resource
	// Deprecated: implemented only by the kubernetes resource client. Will be removed from the interface.
	Register() error
	Read(namespace, name string, opts ReadOpts) (resources.Resource, error)
	Write(resource resources.Resource, opts WriteOpts) (resources.Resource, error)
	Delete(namespace, name string, opts DeleteOpts) error
	List(namespace string, opts ListOpts) (resources.ResourceList, error)
	ResourceWatcher
}

type ResourceClients

type ResourceClients map[string]ResourceClient

func (ResourceClients) Add

func (r ResourceClients) Add(rcs ...ResourceClient)

func (ResourceClients) ForKind

func (r ResourceClients) ForKind(kind string) (ResourceClient, error)

func (ResourceClients) ForResource

func (r ResourceClients) ForResource(resource resources.Resource) (ResourceClient, error)

type ResourceWatch

type ResourceWatch func(ctx context.Context) (<-chan resources.ResourceList, <-chan error, error)

type ResourceWatcher

type ResourceWatcher interface {
	Watch(namespace string, opts WatchOpts) (<-chan resources.ResourceList, <-chan error, error)
}

type StorageWriteOpts

type StorageWriteOpts interface {
	StorageWriteOptsTag()
}

type WatchOpts

type WatchOpts struct {
	Ctx context.Context

	// Equality-based label requirements
	// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#equality-based-requirement
	// Equality-based requirements allow filtering by label keys and values.
	// Matching objects must satisfy all of the specified label constraints,
	// though they may have additional labels as well.
	// Example:
	//	{product: edge} would return all objects with a label key equal to
	//	product and label value equal to edge
	// If both ExpressionSelector and Selector are defined, ExpressionSelector is preferred
	Selector map[string]string
	// Set-based label requirements
	// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#set-based-requirement
	// Set-based label requirements allow filtering keys according to a set of values.
	// Three kinds of operators are supported: in,notin and exists (only the key identifier).
	// Set-based requirements can be mixed with equality-based requirements.
	// Example:
	//	"product in (edge, mesh),version=v1" would return all objects that match ALL of the following:
	//	 (1) the label key equal to product and value equal to edge or mesh
	//	 (2) the label key equal to version and the value equal to v1
	// If both ExpressionSelector and Selector are defined, ExpressionSelector is preferred
	ExpressionSelector string
	RefreshRate        time.Duration
	// Cluster is ignored by aggregated watches, but is respected by multi cluster clients.
	Cluster string
}

RefreshRate is currently ignored by the Kubernetes ResourceClient implementation. To achieve a similar behavior you can use the KubeResourceClientFactory.ResyncPeriod field. The difference is that it will apply to all the watches started by clients built with the factory.

func (WatchOpts) WithDefaults

func (o WatchOpts) WithDefaults() WatchOpts

type WriteOpts

type WriteOpts struct {
	Ctx               context.Context
	OverwriteExisting bool

	// Implementation dependant write opts
	StorageWriteOpts StorageWriteOpts
}

func (WriteOpts) WithDefaults

func (o WriteOpts) WithDefaults() WriteOpts

Directories

Path Synopsis
crd
crd/client/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
crd/client/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
crd/client/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
crd/client/clientset/versioned/typed/solo.io/v1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
crd/client/clientset/versioned/typed/solo.io/v1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
crd/solo.io/v1
Package v1 is the v1 version of the API.
Package v1 is the v1 version of the API.
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
multicluster
factory/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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