duck

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: Apache-2.0 Imports: 23 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) (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 AddressableInformer

type AddressableInformer interface {
	NewTracker(callback func(string), lease time.Duration) AddressableTracker
}

AddressableInformer is an informer that allows tracking arbitrary Addressables.

func NewAddressableInformer

func NewAddressableInformer(ctx context.Context) AddressableInformer

NewAddressableInformer creates a new AddressableInformer.

type AddressableTracker added in v0.7.0

type AddressableTracker interface {
	tracker.Interface

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

A tracker capable of tracking Addressables.

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 NewInjectionSinkReconciler added in v0.7.0

func NewInjectionSinkReconciler(ctx context.Context, callback func(string)) *SinkReconciler

NewSinkReconciler creates and initializes a new SinkReconciler

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