duck

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

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
	// 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)
}

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 SinkReconciler

type SinkReconciler struct {
	// contains filtered or unexported fields
}

SinkReconciler is a helper for Sources. It triggers reconciliation on creation, updates to or deletion of the source's sink.

func NewSinkReconciler

func NewSinkReconciler(ctx context.Context, callback func(types.NamespacedName)) *SinkReconciler

NewSinkReconciler creates and initializes a new SinkReconciler

func (*SinkReconciler) GetSinkURI

func (r *SinkReconciler) GetSinkURI(sinkObjRef *corev1.ObjectReference, source interface{}, sourceDesc string) (string, error)

GetSinkURI registers the given object reference with the tracker and if possible, retrieves the sink URI

type Track

type Track func(corev1.ObjectReference) error

Jump to

Keyboard shortcuts

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