typed

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithClientReader

func WithClientReader(cache client.Reader) func(opts *options)

WithClientReader is used to pass in a client parameter, and you can choose to pass in an existing client or use WithRestConfig to pass in the rest config to generate one.

func WithRestConfig

func WithRestConfig(config *rest.Config) func(opts *options)

WithRestConfig is used to pass in the rest config parameter, which is used to generate a client. The default value is InClusterConfig.

func WithScheme

func WithScheme(scheme *runtime.Scheme) func(opts *options)

WithScheme sets the custom scheme for the client. The default value is Kubernetes scheme.

Types

type Client

type Client interface {
	// Get retrieves an object for the given object key.
	Get(ctx context.Context, key types.NamespacedName, opts ...client.GetOption) (client.Object, error)
	// List retrieves list of objects for a given namespace and list options.
	List(ctx context.Context, namespace string, opts ...client.ListOption) (client.ObjectList, error)
}

Client is a typed client that allows for querying objects directly through their GVK (group, version, and kind) without having to pre-initialize objects of the corresponding type.

func NewTypedClient

func NewTypedClient(gvk schema.GroupVersionKind, opts ...func(*options)) (Client, error)

NewTypedClient returns a new Client implementation.

func NewUnstructuredTypedClient

func NewUnstructuredTypedClient(gvk schema.GroupVersionKind, opts ...func(*options)) (Client, error)

NewUnstructuredTypedClient returns a new Client implementation that returns all objects as Unstructured objects.

Jump to

Keyboard shortcuts

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