testing

package
v0.0.0-...-11b31ba Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenURLPath     = "/auth"
	MessagingURLPath = "/messaging"
)
View Source
const (
	ApplicationName         = "testapp1023"
	ApplicationNameNotClean = "test-app_1-0+2=3"

	OrderCreatedUncleanEvent = "order.cre-ä+t*ed.v2"
	OrderCreatedCleanEvent   = "order.cre-ä+ted.v2"
	EventSourceUnclean       = "s>o>*u*r>c.e"
	EventSourceClean         = "source"

	EventMeshProtocol = "BEB"

	EventMeshNamespaceNS        = "/default/ns"
	EventMeshNamespace          = "/default/kyma/id"
	EventSource                 = "/default/kyma/id"
	EventTypePrefix             = "prefix"
	EventMeshPrefix             = "one.two.three"      // three segments
	InvalidEventMeshPrefix      = "one.two.three.four" // four segments
	EventTypePrefixEmpty        = ""
	OrderCreatedV1Event         = "order.created.v1"
	OrderCreatedV2Event         = "order.created.v2"
	OrderCreatedV1EventNotClean = "order.c*r%e&a!te#d.v1"
	JetStreamSubject            = "kyma" + "." + EventSourceClean + "." + OrderCreatedV1Event
	JetStreamSubjectV2          = "kyma" + "." + EventSourceClean + "." + OrderCreatedCleanEvent

	EventMeshExactType          = EventMeshPrefix + "." + ApplicationNameNotClean + "." + OrderCreatedV1EventNotClean
	EventMeshOrderCreatedV1Type = EventMeshPrefix + "." + ApplicationName + "." + OrderCreatedV1Event

	OrderCreatedEventType            = EventTypePrefix + "." + ApplicationName + "." + OrderCreatedV1Event
	OrderCreatedEventTypeNotClean    = EventTypePrefix + "." + ApplicationNameNotClean + "." + OrderCreatedV1Event
	OrderCreatedEventTypePrefixEmpty = ApplicationName + "." + OrderCreatedV1Event

	CloudEventType  = EventTypePrefix + "." + ApplicationName + ".order.created.v1"
	CloudEventData  = "{\"foo\":\"bar\"}"
	CloudEventData2 = "{\"foo\":\"bar2\"}"

	JSStreamName = "kyma"

	EventID = "8945ec08-256b-11eb-9928-acde48001122"

	CloudEventSource      = "/default/sap.kyma/id"
	CloudEventSpecVersion = "1.0"

	CeIDHeader          = "ce-id"
	CeTypeHeader        = "ce-type"
	CeSourceHeader      = "ce-source"
	CeSpecVersionHeader = "ce-specversion"
)

Variables

View Source
var (
	ErrEventNotReceived       = errors.New("event not received")
	ErrUnexpectedResponseCode = errors.New("unexpected response code received")
	ErrWrongRetries           = errors.New("wrong number of retries")
)

Functions

func AddEventType

func AddEventType(eventType string, subscription *eventingv1alpha2.Subscription)

AddEventType adds a new type to the subscription.

func AddSource

func AddSource(source string, subscription *eventingv1alpha2.Subscription)

AddSource adds the source value to the subscription.

func DefaultReadyCondition

func DefaultReadyCondition() eventingv1alpha2.Condition

func EventMeshAuthResponseSuccess

func EventMeshAuthResponseSuccess(w http.ResponseWriter)

EventMeshAuthResponseSuccess writes an oauth2 authentication Response to the writer for the happy-path.

func EventMeshCreateSuccess

func EventMeshCreateSuccess(w http.ResponseWriter)

EventMeshCreateSuccess writes a Response to the writer for the happy-path of creating an EventMesh subscription.

func EventMeshDeleteResponseSuccess

func EventMeshDeleteResponseSuccess(w http.ResponseWriter)

EventMeshDeleteResponseSuccess writes a Response to the writer for the happy-path of deleting an EventMesh subscription.

func EventMeshGetSuccess

func EventMeshGetSuccess(w http.ResponseWriter, name string)

EventMeshGetSuccess writes a Response to the writer for the happy-path of getting an EventMesh subscription.

func EventMeshListSuccess

func EventMeshListSuccess(w http.ResponseWriter)

EventMeshListSuccess writes a Response to the writer for the happy-path of listing a EventMesh subscription.

func GetBinaryMessageHeaders

func GetBinaryMessageHeaders() http.Header

func GetFreePort

func GetFreePort() (int, error)

GetFreePort determines a free port on the host. It does so by delegating the job to net.ListenTCP. Then providing a port of 0 to net.ListenTCP, it will automatically choose a port for us.

func GetRestAPIObject

func GetRestAPIObject(u *url.URL) string

GetRestAPIObject gets the name of the involved object in a REST url. e.g. "/messaging/events/subscriptions/{subscriptionName}" => "{subscriptionName}".

func GetStructuredMessageHeaders

func GetStructuredMessageHeaders() http.Header

func HaveAPIRuleName

func HaveAPIRuleName(name string) gomegatypes.GomegaMatcher

func HaveAPIRuleOwnersRefs

func HaveAPIRuleOwnersRefs(uids ...ktypes.UID) gomegatypes.GomegaMatcher

func HaveAPIRuleSpecRules

func HaveAPIRuleSpecRules(ruleMethods []string, accessStrategy, certsURL, path string) gomegatypes.GomegaMatcher

func HaveAPIRuleSpecRulesWithOry

func HaveAPIRuleSpecRulesWithOry(ruleMethods []string, accessStrategy, path string) gomegatypes.GomegaMatcher

func HaveAPIRuleTrueStatusCondition

func HaveAPIRuleTrueStatusCondition() gomegatypes.GomegaMatcher

func HaveCleanEventTypes

func HaveCleanEventTypes(cleanEventTypes []eventingv1alpha2.EventType) gomegatypes.GomegaMatcher

func HaveEvent

func HaveEvent(event kcorev1.Event) gomegatypes.GomegaMatcher

func HaveMaxInFlight

func HaveMaxInFlight(maxInFlight int) gomegatypes.GomegaMatcher

func HaveNonZeroEv2Hash

func HaveNonZeroEv2Hash() gomegatypes.GomegaMatcher

func HaveNonZeroEventMeshHash

func HaveNonZeroEventMeshHash() gomegatypes.GomegaMatcher

func HaveNonZeroEventMeshLocalHash

func HaveNonZeroEventMeshLocalHash() gomegatypes.GomegaMatcher

func HaveNonZeroWebhookAuthHash

func HaveNonZeroWebhookAuthHash() gomegatypes.GomegaMatcher

func HaveNoneEmptyAPIRuleName

func HaveNoneEmptyAPIRuleName() gomegatypes.GomegaMatcher

func HaveNotEmptyAPIRule

func HaveNotEmptyAPIRule() gomegatypes.GomegaMatcher

func HaveNotEmptyHost

func HaveNotEmptyHost() gomegatypes.GomegaMatcher

func HaveNotFoundSubscription

func HaveNotFoundSubscription() gomegatypes.GomegaMatcher

func HaveStatusTypes

func HaveStatusTypes(cleanEventTypes []eventingv1alpha2.EventType) gomegatypes.GomegaMatcher

func HaveSubscriptionActiveCondition

func HaveSubscriptionActiveCondition() gomegatypes.GomegaMatcher

func HaveSubscriptionFinalizer

func HaveSubscriptionFinalizer(finalizer string) gomegatypes.GomegaMatcher

func HaveSubscriptionName

func HaveSubscriptionName(name string) gomegatypes.GomegaMatcher

func HaveSubscriptionNotReady

func HaveSubscriptionNotReady() gomegatypes.GomegaMatcher

func HaveSubscriptionReady

func HaveSubscriptionReady() gomegatypes.GomegaMatcher

func HaveTypeMatching

func HaveTypeMatching(typeMatching eventingv1alpha2.TypeMatching) gomegatypes.GomegaMatcher

func HaveTypes

func HaveTypes(types []string) gomegatypes.GomegaMatcher

func HaveValidBEBNamespace

func HaveValidBEBNamespace(bebNamespaceKey, namespace string) gomegatypes.GomegaMatcher

func HaveValidClientID

func HaveValidClientID(clientIDKey, clientID string) gomegatypes.GomegaMatcher

func HaveValidClientSecret

func HaveValidClientSecret(clientSecretKey, clientSecret string) gomegatypes.GomegaMatcher

func HaveValidEMSPublishURL

func HaveValidEMSPublishURL(emsPublishURLKey, emsPublishURL string) gomegatypes.GomegaMatcher

func HaveValidTokenEndpoint

func HaveValidTokenEndpoint(tokenEndpointKey, tokenEndpoint string) gomegatypes.GomegaMatcher

func IsAnEmptySubscription

func IsAnEmptySubscription() gomegatypes.GomegaMatcher

func IsEventMeshSubscriptionCreate

func IsEventMeshSubscriptionCreate(r *http.Request) bool

IsEventMeshSubscriptionCreate determines if the http request is creating an EventMesh subscription.

func IsEventMeshSubscriptionDelete

func IsEventMeshSubscriptionDelete(r *http.Request) bool

IsEventMeshSubscriptionDelete determines if the http request is deleting a EventMesh subscription.

func MarkReady

func MarkReady(rule *apigatewayv1beta1.APIRule)

func NewAPIRule

func NewAPIRule(subscription *eventingv1alpha2.Subscription, opts ...APIRuleOption) *apigatewayv1beta1.APIRule

NewAPIRule returns a valid APIRule.

func NewBEBMessagingSecret

func NewBEBMessagingSecret(name, namespace string) *kcorev1.Secret

func NewEventMeshSubscription

func NewEventMeshSubscription(name, contentMode string, webhookURL string, events types.Events,
	webhookAuth *types.WebhookAuth,
) *types.Subscription

func NewFakeSubscriptionClient

func NewFakeSubscriptionClient(sub *eventingv1alpha2.Subscription) (dynamic.Interface, error)

NewFakeSubscriptionClient returns a fake dynamic subscription client.

func NewNamespace

func NewNamespace(name string) *kcorev1.Namespace

func NewSampleEventMeshSubscription

func NewSampleEventMeshSubscription() *types.Subscription

func NewSubscriberSvc

func NewSubscriberSvc(name, namespace string) *kcorev1.Service

func NewSubscription

func NewSubscription(name, namespace string, opts ...SubscriptionOpt) *eventingv1alpha2.Subscription

func RunNatsServerOnPort

func RunNatsServerOnPort(opts ...NatsServerOpt) *server.Server

RunNatsServerOnPort will run a server with the given server options.

func SetSink

func SetSink(svcNamespace, svcName string, subscription *eventingv1alpha2.Subscription)

SetSink sets the subscription's sink to a valid sink created from svcNameSpace and svcName.

func SetupSchemeOrDie

func SetupSchemeOrDie() (*kruntime.Scheme, error)

SetupSchemeOrDie add a scheme to eventing API schemes.

func ShutDownNATSServer

func ShutDownNATSServer(natsServer *server.Server)

ShutDownNATSServer shuts down test NATS server and waits until shutdown is complete.

func StartDefaultJetStreamServer

func StartDefaultJetStreamServer(port int) *server.Server

StartDefaultJetStreamServer will run a server on the given port.

func SubscriptionGroupVersionResource

func SubscriptionGroupVersionResource() kschema.GroupVersionResource

SubscriptionGroupVersionResource returns the GVR of a subscription.

func ToSubscription

func ToSubscription(unstructuredSub *kunstructured.Unstructured) (*eventingv1alpha2.Subscription, error)

ToSubscription converts an unstructured subscription into a typed one.

func ToUnstructuredAPIRule

func ToUnstructuredAPIRule(obj interface{}) (*kunstructured.Unstructured, error)

ToUnstructuredAPIRule converts an APIRule object into a unstructured APIRule.

func ValidSinkURL

func ValidSinkURL(namespace, svcName string) string

ValidSinkURL converts a namespace and service name to a valid sink url.

func ValidSinkURLWithPath

func ValidSinkURLWithPath(namespace, svcName, path string) string

ValidSinkURLWithPath converts a namespace and service name to a valid sink url with path.

Types

type APIRuleOption

type APIRuleOption func(r *apigatewayv1beta1.APIRule)

func WithPath

func WithPath() APIRuleOption

func WithService

func WithService(name, host string) APIRuleOption

type EventMeshMock

type EventMeshMock struct {
	Requests      *SafeRequests
	Subscriptions *SafeSubscriptions
	TokenURL      string
	MessagingURL  string

	AuthResponse        Response
	GetResponse         ResponseWithName
	ListResponse        Response
	CreateResponse      Response
	UpdateResponse      ResponseUpdateReq
	UpdateStateResponse ResponseUpdateStateReq
	DeleteResponse      Response

	ResponseOverrides *EventMeshMockResponseOverride
	// contains filtered or unexported fields
}

EventMeshMock implements a programmable mock for EventMesh.

func NewEventMeshMock

func NewEventMeshMock() *EventMeshMock

func (*EventMeshMock) AddCreateResponseOverride

func (m *EventMeshMock) AddCreateResponseOverride(key string, responseFunc ResponseWithSub)

func (*EventMeshMock) AddGetResponseOverride

func (m *EventMeshMock) AddGetResponseOverride(key string, responseFunc ResponseWithName)

func (*EventMeshMock) CountRequests

func (m *EventMeshMock) CountRequests(method, uri string) int

CountRequests counts the mock API requests using the given HTTP method and URI.

func (*EventMeshMock) Reset

func (m *EventMeshMock) Reset()

func (*EventMeshMock) ResetResponseOverrides

func (m *EventMeshMock) ResetResponseOverrides()

func (*EventMeshMock) Start

func (m *EventMeshMock) Start() string

func (*EventMeshMock) Stop

func (m *EventMeshMock) Stop()

type EventMeshMockResponseOverride

type EventMeshMockResponseOverride struct {
	CreateResponse map[string]ResponseWithSub
	GetResponse    map[string]ResponseWithName
}

func NewEventMeshMockResponseOverride

func NewEventMeshMockResponseOverride() *EventMeshMockResponseOverride

type NatsServerOpt

type NatsServerOpt func(opts *server.Options)

func WithJetStreamEnabled

func WithJetStreamEnabled() NatsServerOpt

func WithPort

func WithPort(port int) NatsServerOpt

type Response

type Response func(w http.ResponseWriter)

type ResponseUpdateReq

type ResponseUpdateReq func(w http.ResponseWriter, key string, webhookAuth *emstypes.WebhookAuth)

func UpdateSubscriptionResponse

func UpdateSubscriptionResponse(m *EventMeshMock) ResponseUpdateReq

UpdateSubscriptionResponse updates the webhook auth of subscription in the mock.

type ResponseUpdateStateReq

type ResponseUpdateStateReq func(w http.ResponseWriter, key string, state emstypes.State) error

func UpdateSubscriptionStateResponse

func UpdateSubscriptionStateResponse(mock *EventMeshMock) ResponseUpdateStateReq

UpdateSubscriptionStateResponse updates the EventMesh subscription status in the mock.

type ResponseWithName

type ResponseWithName func(w http.ResponseWriter, subscriptionName string)

func GetSubscriptionResponse

func GetSubscriptionResponse(m *EventMeshMock) ResponseWithName

GetSubscriptionResponse checks if a subscription exists in the mock.

type ResponseWithSub

type ResponseWithSub func(w http.ResponseWriter, subscription emstypes.Subscription)

type SafeRequests

type SafeRequests struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

SafeRequests encapsulates Requests to provide mutual exclusion.

func NewSafeRequests

func NewSafeRequests() *SafeRequests

NewSafeRequests returns a new instance of SafeRequests.

func (*SafeRequests) GetSubscriptionNames

func (r *SafeRequests) GetSubscriptionNames() map[*http.Request]string

GetSubscriptionNames converts requests to a map of http requests and the actual subscription names.

func (*SafeRequests) GetSubscriptions

func (r *SafeRequests) GetSubscriptions() map[*http.Request]types.Subscription

GetSubscriptions converts requests to a map of http requests and the actual subscriptions.

func (*SafeRequests) Len

func (r *SafeRequests) Len() int

Len returns the length of requests.

func (*SafeRequests) PutSubscription

func (r *SafeRequests) PutSubscription(request *http.Request, subscription types.Subscription)

PutSubscription sets the subscription of a request.

func (*SafeRequests) ReadEach

func (r *SafeRequests) ReadEach(f func(request *http.Request, payload interface{}))

ReadEach iterates over requests and executes a given func f with each iteration's request and payload.

func (*SafeRequests) StoreRequest

func (r *SafeRequests) StoreRequest(request *http.Request)

StoreRequest adds a request to requests and sets it's corresponding subscription to nil.

type SafeSubscriptions

type SafeSubscriptions struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

SafeSubscriptions encapsulates Subscriptions to provide mutual exclusion.

func NewSafeSubscriptions

func NewSafeSubscriptions() *SafeSubscriptions

NewSafeSubscriptions returns a new instance of SafeSubscriptions.

func (*SafeSubscriptions) DeleteSubscription

func (s *SafeSubscriptions) DeleteSubscription(key string)

DeleteSubscription deletes a Subscription via the corresponding key.

func (*SafeSubscriptions) DeleteSubscriptionsByName

func (s *SafeSubscriptions) DeleteSubscriptionsByName(name string)

DeleteSubscriptionsByName deletes all Subscriptions that contain the substring name in their own name.

func (*SafeSubscriptions) GetSubscription

func (s *SafeSubscriptions) GetSubscription(key string) *emstypes.Subscription

GetSubscription returns a Subscription via the corresponding key.

func (*SafeSubscriptions) PutSubscription

func (s *SafeSubscriptions) PutSubscription(key string, subscription *emstypes.Subscription)

PutSubscription adds a Subscription and it's corresponding key to SafeSubscriptions.

type Subscriber

type Subscriber struct {
	SinkURL string

	InternalErrorURL string
	// contains filtered or unexported fields
}

func NewSubscriber

func NewSubscriber(opts ...SubscriberOption) *Subscriber

NewSubscriber creates a simple test Subscriber with http Endpoints to received, store end answer event data. NewSubscriber accepts SubscriberOpts for customization.

func (Subscriber) CheckEvent

func (s Subscriber) CheckEvent(expectedData string) error

CheckEvent checks if the Subscriber received the expected string and will return an error if this is not the case.

func (Subscriber) CheckRetries

func (s Subscriber) CheckRetries(expectedNoOfRetries int, expectedData string) error

CheckRetries checks if the number of retries specified by expectedData was done and if the data sent on each retry was correctly received.

func (*Subscriber) GetSubscriberListener

func (s *Subscriber) GetSubscriberListener() net.Listener

func (*Subscriber) IsRunning

func (s *Subscriber) IsRunning() bool

func (*Subscriber) Shutdown

func (s *Subscriber) Shutdown()

type SubscriberOption

type SubscriberOption func(*Subscriber)

func WithCloudEventServeMux

func WithCloudEventServeMux() SubscriberOption

WithCloudEventServeMux will make the Subscriber store all CloudEvent-related date ("ce-..." header etc) at its "/store" e Endpoint instead of its default behaviour of only storing the http.Request.Body data.

func WithListener

func WithListener(listener net.Listener) SubscriberOption

type SubscriptionOpt

type SubscriptionOpt func(subscription *eventingv1alpha2.Subscription)

func WithBackend

func WithBackend(backend eventingv1alpha2.Backend) SubscriptionOpt

WithBackend is a SubscriptionOpt that sets the status with the Backend value.

func WithCleanEventSourceAndType

func WithCleanEventSourceAndType() SubscriptionOpt

WithCleanEventSourceAndType is a SubscriptionOpt that initializes subscription with a not clean event source and type.

func WithCleanEventTypeOld

func WithCleanEventTypeOld() SubscriptionOpt

WithCleanEventTypeOld is a SubscriptionOpt that initializes subscription with a not clean event type from v1alpha2.

func WithConditions

func WithConditions(conditions []eventingv1alpha2.Condition) SubscriptionOpt

func WithConfigValue

func WithConfigValue(key, value string) SubscriptionOpt

func WithDefaultSource

func WithDefaultSource() SubscriptionOpt

func WithEmptyConfig

func WithEmptyConfig() SubscriptionOpt

func WithEmptyStatus

func WithEmptyStatus() SubscriptionOpt

func WithEmsSubscriptionStatus

func WithEmsSubscriptionStatus(status string) SubscriptionOpt

func WithEventMeshExactType

func WithEventMeshExactType() SubscriptionOpt

func WithEventSource

func WithEventSource(source string) SubscriptionOpt

WithEventSource is a SubscriptionOpt for creating a Subscription with a specific event source,.

func WithEventType

func WithEventType(eventType string) SubscriptionOpt

WithEventType is a SubscriptionOpt for creating a Subscription with a specific event type, that itself gets created from the passed eventType.

func WithExactTypeMatching

func WithExactTypeMatching() SubscriptionOpt

WithExactTypeMatching is a SubscriptionOpt for creating a Subscription with an exact type matching.

func WithFakeSubscriptionStatus

func WithFakeSubscriptionStatus() SubscriptionOpt

func WithFinalizers

func WithFinalizers(finalizers []string) SubscriptionOpt

func WithInvalidProtocolSettingsQos

func WithInvalidProtocolSettingsQos() SubscriptionOpt

func WithInvalidWebhookAuthGrantType

func WithInvalidWebhookAuthGrantType() SubscriptionOpt

func WithInvalidWebhookAuthType

func WithInvalidWebhookAuthType() SubscriptionOpt

func WithMaxInFlight

func WithMaxInFlight(maxInFlight int) SubscriptionOpt

WithMaxInFlight is a SubscriptionOpt that sets the status with the maxInFlightMessages int value.

func WithMaxInFlightMessages

func WithMaxInFlightMessages(maxInFlight string) SubscriptionOpt

WithMaxInFlightMessages is a SubscriptionOpt that sets the status with the maxInFlightMessages string value.

func WithNonZeroDeletionTimestamp

func WithNonZeroDeletionTimestamp() SubscriptionOpt

WithNonZeroDeletionTimestamp sets the deletion timestamp of the subscription to Now().

func WithNotCleanEventSourceAndType

func WithNotCleanEventSourceAndType() SubscriptionOpt

WithNotCleanEventSourceAndType is a SubscriptionOpt that initializes subscription with a not clean event source and type.

func WithNotCleanSource

func WithNotCleanSource() SubscriptionOpt

func WithNotCleanType

func WithNotCleanType() SubscriptionOpt

WithNotCleanType initializes subscription with a not clean event-type A not clean event-type means it contains none-alphanumeric characters.

func WithOrderCreatedFilter

func WithOrderCreatedFilter() SubscriptionOpt

func WithOrderCreatedV1Event

func WithOrderCreatedV1Event() SubscriptionOpt

func WithProtocolEventMesh

func WithProtocolEventMesh() SubscriptionOpt

func WithSink

func WithSink(sink string) SubscriptionOpt

func WithSinkURL

func WithSinkURL(sinkURL string) SubscriptionOpt

WithSinkURL is a SubscriptionOpt for creating a subscription with a specific sink.

func WithSinkURLFromSvc

func WithSinkURLFromSvc(svc *kcorev1.Service) SubscriptionOpt

WithSinkURLFromSvc sets a kubernetes service as the sink.

func WithSource

func WithSource(source string) SubscriptionOpt

func WithSourceAndType

func WithSourceAndType(eventSource, eventType string) SubscriptionOpt

WithSourceAndType is a SubscriptionOpt for creating a Subscription with a specific eventSource and eventType.

func WithStandardTypeMatching

func WithStandardTypeMatching() SubscriptionOpt

WithStandardTypeMatching is a SubscriptionOpt for creating a Subscription with a standard type matching.

func WithStatus

func WithStatus(status bool) SubscriptionOpt

func WithStatusJSBackendTypes

func WithStatusJSBackendTypes(types []eventingv1alpha2.JetStreamTypes) SubscriptionOpt

func WithStatusTypes

func WithStatusTypes(cleanEventTypes []eventingv1alpha2.EventType) SubscriptionOpt

func WithTypeMatching

func WithTypeMatching(typeMatching eventingv1alpha2.TypeMatching) SubscriptionOpt

WithTypeMatching is a SubscriptionOpt for creating a Subscription with a specific type matching,.

func WithTypeMatchingExact

func WithTypeMatchingExact() SubscriptionOpt

WithTypeMatchingExact is a SubscriptionOpt that initializes the subscription with type matching to exact.

func WithTypeMatchingStandard

func WithTypeMatchingStandard() SubscriptionOpt

WithTypeMatchingStandard is a SubscriptionOpt that initializes the subscription with type matching to standard.

func WithTypes

func WithTypes(types []string) SubscriptionOpt

func WithValidSink

func WithValidSink(svcNamespace, svcName string) SubscriptionOpt

WithValidSink is a SubscriptionOpt for creating a subscription with a valid sink that itself gets created from the svcNamespace and the svcName.

func WithWebhookAuthForEventMesh

func WithWebhookAuthForEventMesh() SubscriptionOpt

Directories

Path Synopsis
event

Jump to

Keyboard shortcuts

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