dao

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accessor

type Accessor interface {
	Lister
	Getter

	// Init the resource with a factory object.
	Init(types.Factory, client.GVR)

	// GVR returns a gvr a string.
	GVR() string
}

Accessor represents an accessible k8s resource.

type Generic

type Generic struct {
	NonResource
}

Generic represents a generic resource.

func (*Generic) Get

func (g *Generic) Get(ctx context.Context, path string) (runtime.Object, error)

Get returns a given resource.

func (*Generic) List

func (g *Generic) List(ctx context.Context) ([]runtime.Object, error)

List returns a collection of resources.

type Getter

type Getter interface {
	// Get return a given resource.
	Get(ctx context.Context, path string) (runtime.Object, error)
}

Getter represents a resource getter.

type Lister

type Lister interface {
	// List returns a resource collection.
	List(ctx context.Context) ([]runtime.Object, error)
}

Lister represents a resource lister.

type NonResource

type NonResource struct {
	types.Factory
	// contains filtered or unexported fields
}

NonResource represents a non k8s resource.

func (*NonResource) GVR

func (n *NonResource) GVR() string

GVR returns a gvr.

func (*NonResource) Get

Get returns the given resource.

func (*NonResource) Init

func (n *NonResource) Init(f types.Factory, gvr client.GVR)

Init initializes the resource.

type Resource

type Resource struct {
	Generic
}

Resource represents an informer based resource.

func (*Resource) Get

func (r *Resource) Get(_ context.Context, path string) (runtime.Object, error)

Get returns a resource instance if found, else an error.

func (*Resource) List

func (r *Resource) List(ctx context.Context) ([]runtime.Object, error)

List returns a collection of resources.

type ResourceMetas

type ResourceMetas map[client.GVR]metav1.APIResource

ResourceMetas represents a collection of resource metadata.

Jump to

Keyboard shortcuts

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