subscribed

package
v0.0.0-...-5cf3e1d Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GVR = schema.GroupVersionResource{
		Version:  eventingv1alpha2.GroupVersion.Version,
		Group:    eventingv1alpha2.GroupVersion.Group,
		Resource: "subscriptions",
	}
	GVRV1alpha1 = schema.GroupVersionResource{
		Version:  eventingv1alpha1.GroupVersion.Version,
		Group:    eventingv1alpha1.GroupVersion.Group,
		Resource: "subscriptions",
	}
)

Functions

func AddUniqueEventsToResult

func AddUniqueEventsToResult(eventsSubSet []Event, uniqEvents map[Event]bool) map[Event]bool

AddUniqueEventsToResult returns a map of unique Events which also contains the events eventsSubSet.

func ConvertRuntimeObjToSubscription

func ConvertRuntimeObjToSubscription(sObj runtime.Object) (*eventingv1alpha2.Subscription, error)

ConvertRuntimeObjToSubscription converts a runtime.Object to a Subscription object by converting to unstructured in between.

func ConvertRuntimeObjToSubscriptionV1alpha1

func ConvertRuntimeObjToSubscriptionV1alpha1(sObj runtime.Object) (*eventingv1alpha1.Subscription, error)

ConvertRuntimeObjToSubscriptionV1alpha1 converts a runtime.Object to a v1alpha1 version of Subscription object by converting to unstructured in between.

func GenerateSubscriptionInfFactory

func GenerateSubscriptionInfFactory(k8sConfig *rest.Config) dynamicinformer.DynamicSharedInformerFactory

GenerateSubscriptionInfFactory generates DynamicSharedInformerFactory for Subscription.

func RespondWithBody

func RespondWithBody(w http.ResponseWriter, events Events, httpCode int)

RespondWithBody sends http response with json body.

func RespondWithErrorAndLog

func RespondWithErrorAndLog(e error, w http.ResponseWriter)

RespondWithErrorAndLog logs error and sends http response with error json body.

Types

type Event

type Event struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

Event represents basic information about event.

func ConvertEventsMapToSlice

func ConvertEventsMapToSlice(eventsMap map[Event]bool) []Event

ConvertEventsMapToSlice converts a map of Events to a slice of Events.

func FilterEventTypeVersions

func FilterEventTypeVersions(eventTypePrefix, appName string, subscription *eventingv1alpha2.Subscription) []Event

FilterEventTypeVersions returns a slice of Events: if the event source matches the appName for typeMatching standard if the <eventTypePrefix>.<appName> is present in the eventType for typeMatching exact.

func FilterEventTypeVersionsV1alpha1

func FilterEventTypeVersionsV1alpha1(eventTypePrefix, bebNs, appName string, filters *eventingv1alpha1.BEBFilters) []Event

FilterEventTypeVersionsV1alpha1 returns a slice of Events for v1alpha1 version of Subscription resource: 1. if the eventType matches the format: <eventTypePrefix><appName>.<event-name>.<version> E.g. sap.kyma.custom.varkes.order.created.v0 2. if the eventSource matches BEBNamespace name.

type Events

type Events struct {
	EventsInfo []Event `json:"eventsInfo"`
}

Events represents collection of all events with subscriptions.

type Processor

type Processor struct {
	SubscriptionLister *cache.GenericLister
	Prefix             string
	Namespace          string
	Logger             *logger.Logger
}

func (Processor) ExtractEventsFromSubscriptions

func (p Processor) ExtractEventsFromSubscriptions(writer http.ResponseWriter, request *http.Request)

func (Processor) ExtractEventsFromSubscriptionsV1alpha1

func (p Processor) ExtractEventsFromSubscriptionsV1alpha1(writer http.ResponseWriter, request *http.Request)

Jump to

Keyboard shortcuts

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