duck

package
v0.15.4 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: Apache-2.0 Imports: 22 Imported by: 70

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DomainToURL

func DomainToURL(domain string) string

DomainToURL converts a domain into an HTTP URL.

func ObjectReference

func ObjectReference(ctx context.Context, dynamicClient dynamic.Interface, namespace string, ref *corev1.ObjectReference) (json.Marshaler, error)

ObjectReference resolves an object based on an ObjectReference.

func ResourceInterface

func ResourceInterface(dynamicClient dynamic.Interface, namespace string, gvk schema.GroupVersionKind) (dynamic.ResourceInterface, error)

ResourceInterface creates a resource interface for the given ObjectReference.

Types

type ListableTracker added in v0.10.0

type ListableTracker interface {
	// TrackInNamespace returns a function that can be used to watch arbitrary apis.Listable resources in the same
	// namespace as obj. Any change will cause a callback for obj.
	TrackInNamespace(obj metav1.Object) Track
	// TrackInNamespaceKReference returns a function that can be used to watch arbitrary apis.Listable resources
	// in the same namespace as obj. Any change will cause a callback for obj.
	TrackInNamespaceKReference(obj metav1.Object) TrackKReference
	// ListerFor returns the lister for the object reference. It returns an error if the lister does not exist.
	ListerFor(ref corev1.ObjectReference) (cache.GenericLister, error)
	// InformerFor returns the informer for the object reference. It returns an error if the informer does not exist.
	InformerFor(ref corev1.ObjectReference) (cache.SharedIndexInformer, error)
	// ListerFor returns the lister for the KReference. It returns an error if the lister does not exist.
	ListerForKReference(ref duckv1.KReference) (cache.GenericLister, error)
	// InformerFor returns the informer for the KReference. It returns an error if the informer does not exist.
	InformerForKReference(ref duckv1.KReference) (cache.SharedIndexInformer, error)
}

ListableTracker is a tracker capable of tracking any object that implements the apis.Listable interface.

func NewListableTracker added in v0.10.0

func NewListableTracker(ctx context.Context, getter func(context.Context) duck.InformerFactory, callback func(types.NamespacedName), lease time.Duration) ListableTracker

NewListableTracker creates a new ListableTracker, backed by a TypedInformerFactory.

type Track

type Track func(corev1.ObjectReference) error

type TrackKReference added in v0.15.0

type TrackKReference func(duckv1.KReference) error

Jump to

Keyboard shortcuts

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