popeye: github.com/derailed/popeye/internal/dao Index | Files

package dao

import "github.com/derailed/popeye/internal/dao"

Index

Package Files

generic.go non_resource.go resource.go types.go

type Accessor Uses

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 Uses

type Generic struct {
    NonResource
}

Generic represents a generic resource.

func (*Generic) Get Uses

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

Get returns a given resource.

func (*Generic) List Uses

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

List returns a collection of resources.

type Getter Uses

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

Getter represents a resource getter.

type Lister Uses

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

Lister represents a resource lister.

type NonResource Uses

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

NonResource represents a non k8s resource.

func (*NonResource) GVR Uses

func (n *NonResource) GVR() string

GVR returns a gvr.

func (*NonResource) Get Uses

func (n *NonResource) Get(context.Context, string) (runtime.Object, error)

Get returns the given resource.

func (*NonResource) Init Uses

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

Init initializes the resource.

type Resource Uses

type Resource struct {
    Generic
}

Resource represents an informer based resource.

func (*Resource) Get Uses

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

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

func (*Resource) List Uses

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

List returns a collection of resources.

type ResourceMetas Uses

type ResourceMetas map[client.GVR]metav1.APIResource

ResourceMetas represents a collection of resource metadata.

Package dao imports 11 packages (graph) and is imported by 1 packages. Updated 2020-07-07. Refresh now. Tools for package owners.