duck

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2019 License: Apache-2.0 Imports: 24 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) (duck.Marshalable, 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.

func SubscriberSpec

func SubscriberSpec(ctx context.Context, dynamicClient dynamic.Interface, namespace string, s *v1alpha1.SubscriberSpec, track Track) (string, error)

SubscriberSpec resolves the Spec.Call object. If it's an ObjectReference, it will resolve the object and treat it as an Addressable. If it's a DNSName, then it's used as is. TODO: Once Service Routes, etc. support Callable, use that.

Types

type ResourceInformer added in v0.8.0

type ResourceInformer interface {
	NewTracker(callback func(string), lease time.Duration) ResourceTracker
}

ResourceInformer is an informer that allows tracking arbitrary Resources.

func NewResourceInformer added in v0.8.0

func NewResourceInformer(ctx context.Context) ResourceInformer

NewResourceInformer creates a new ResourceInformer.

type ResourceTracker added in v0.8.0

type ResourceTracker interface {
	// TrackInNamespace returns a function that can be used to watch arbitrary Resources in the same
	// namespace as obj. Any change will cause a callback for obj.
	TrackInNamespace(obj metav1.Object) func(corev1.ObjectReference) error
}

ResourceTracker is a tracker capable of tracking Resources.

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(string)) *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