store

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAs

func GetAs(ctx context.Context, o Store, key Key, as interface{}) error

GetAs gets an object from the object store by key.

func GetObjectAs

func GetObjectAs(ctx context.Context, o Store, key Key, as interface{}) error

GetObjectAs gets an object from the object store by key.

Types

type Key

type Key struct {
	Namespace  string
	APIVersion string
	Kind       string
	Name       string
	Selector   *labels.Set
}

Key is a key for the object store.

func KeyFromObject

func KeyFromObject(object runtime.Object) (Key, error)

KeyFromObject creates a key from a runtime object.

func (Key) GroupVersionKind

func (k Key) GroupVersionKind() schema.GroupVersionKind

GroupVersionKind converts the Key to a GroupVersionKind.

func (Key) String

func (k Key) String() string

type Store

type Store interface {
	List(ctx context.Context, key Key) (list *unstructured.UnstructuredList, loading bool, err error)
	Get(ctx context.Context, key Key) (*unstructured.Unstructured, error)
	Watch(ctx context.Context, key Key, handler cache.ResourceEventHandler) error
	HasAccess(context.Context, Key, string) error
	UpdateClusterClient(ctx context.Context, client cluster.ClientInterface) error
	RegisterOnUpdate(fn UpdateFn)
	Update(ctx context.Context, key Key, updater func(*unstructured.Unstructured) error) error
	IsLoading(ctx context.Context, key Key) bool
}

Store stores Kubernetes objects.

type UpdateFn

type UpdateFn func(store Store)

UpdateFn is a function that is called when

Jump to

Keyboard shortcuts

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