eventfilter

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowEventToDestTransformation added in v1.8.0

func AllowEventToDestTransformation(transformerEvent *transformer.TransformerEventT, supportedMsgTypes []string) (bool, *transformer.TransformerResponseT)

AllowEventToDestTransformation lets the caller know if we need to allow the event to proceed to destination transformation.

Currently this method supports below validations(executed in the same order):

1. Validate if messageType sent in event is included in SupportedMessageTypes

2. Validate if the event is sendable to destination based on connectionMode, sourceType & messageType

func ConvertToArrayOfType added in v1.8.0

func ConvertToArrayOfType[T EventPropsTypes](data interface{}) []T

* Converts interface{} to []T if the go type-assertion allows it

func FilterEventsForHybridMode added in v1.8.0

func FilterEventsForHybridMode(connectionModeFilterParams ConnectionModeFilterParams) (bool, *transformer.TransformerResponseT)

FilterEventsForHybridMode lets the caller know if the event is allowed to flow through server for a `specific destination` Introduced to support hybrid-mode event filtering on cloud-side

The template inside `destinationDefinition.Config.hybridModeCloudEventsFilter` would look like this ```

[sourceType]: {
	[eventProperty]: [...supportedEventPropertyValues]
}

```

Example:

	{
		...
		"hybridModeCloudEventsFilter": {
      "web": {
        "messageType": ["track", "page"]
      }
    },
		...
	}

func GetSupportedMessageEvents

func GetSupportedMessageEvents(destination *backendconfig.DestinationT) ([]string, bool)

GetSupportedEvents returns the supported message events for the given destination, based on configuration. If no relevant configuration is found, returns false

func GetSupportedMessageTypes

func GetSupportedMessageTypes(destination *backendconfig.DestinationT) ([]string, bool)

GetSupportedMessageTypes returns the supported message types for the given event, based on configuration. If no relevant configuration is found, returns false

Types

type AllowTransformerEventParams added in v1.8.0

type AllowTransformerEventParams struct {
	TransformerEvent      *transformer.TransformerEventT
	SupportedMessageTypes []string
}

type ConnectionModeFilterParams added in v1.8.0

type ConnectionModeFilterParams struct {
	Destination      *backendconfig.DestinationT
	SrcType          string
	Event            *EventParams
	DefaultBehaviour bool
}

type EventParams added in v1.8.0

type EventParams struct {
	MessageType string
}

type EventPropsTypes added in v1.8.0

type EventPropsTypes interface {
	~string
}

Jump to

Keyboard shortcuts

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