dao

package
v0.21.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WarnEvt = "Warning"
)

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, types.GVR)

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

Accessor represents an accessible k8s resource.

type Event added in v0.20.0

type Event struct {
	Table
}

type EventInfo added in v0.20.0

type EventInfo struct {
	Kind    string
	Reason  string
	Message string
	Count   int64
}

func (EventInfo) IsIssue added in v0.20.0

func (e EventInfo) IsIssue() bool

type EventInfos added in v0.20.0

type EventInfos []EventInfo

func EventsFor added in v0.20.0

func EventsFor(ctx context.Context, gvr types.GVR, level, kind, fqn string) (EventInfos, error)

func (EventInfos) Issues added in v0.20.0

func (ee EventInfos) Issues() []string

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 types.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[types.GVR]metav1.APIResource

ResourceMetas represents a collection of resource metadata.

type Table added in v0.20.0

type Table struct {
	Generic
}

Table retrieves K8s resources as tabular data.

func (*Table) Get added in v0.20.0

func (t *Table) Get(ctx context.Context, path string) (runtime.Object, error)

Get returns a given resource.

func (*Table) List added in v0.20.0

func (t *Table) List(ctx context.Context, ns string) ([]runtime.Object, error)

List all Resources in a given namespace.

Jump to

Keyboard shortcuts

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