integrations

package
v0.0.0-...-0ade494 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PostDataKV means post data is sent as KV
	PostDataKV = iota + 1
	// PostDataJSON means post data is sent as JSON
	PostDataJSON
	// PostDataXML means post data is sent as XML
	PostDataXML
)

Variables

This section is empty.

Functions

func CollectDestErrorStats

func CollectDestErrorStats(input []byte)

func CollectIntgTransformErrorStats

func CollectIntgTransformErrorStats(input []byte)

func FilterClientIntegrations

func FilterClientIntegrations(clientEvent types.SingularEventT, destNameIDMap map[string]backendconfig.DestinationDefinitionT) (retVal []string)

FilterClientIntegrations parses the destination names from the input JSON, matches them with enabled destinations from controle plane and returns the IDSs

func GetDestinationURL

func GetDestinationURL(destType string) string

GetDestinationURL returns node URL

func GetTrackingPlanValidationURL

func GetTrackingPlanValidationURL() string

GetTrackingPlanValidationURL returns the port of running tracking plan validation

func GetTransformerURL

func GetTransformerURL() string

GetTransformerURL gets the transfomer base url endpoint

func GetUserTransformURL

func GetUserTransformURL() string

GetUserTransformURL returns the port of running user transform

func Init

func Init()

func ValidatePostInfo

func ValidatePostInfo(transformRawParams PostParametersT) error

GetPostInfo parses the transformer response

Types

type PostParametersT

type PostParametersT struct {
	Type          string `json:"type"`
	URL           string `json:"endpoint"`
	RequestMethod string `json:"method"`
	// Invalid tag used in struct. skipcq: SCC-SA5008
	UserID      string                 `json:"userId,,optional"` //nolint:staticcheck
	Headers     map[string]interface{} `json:"headers"`
	QueryParams map[string]interface{} `json:"params"`
	Body        map[string]interface{} `json:"body"`
	Files       map[string]interface{} `json:"files"`
}

PostParametersT is a struct for holding all the values from transformerResponse and use them to publish an event to a destination optional is a custom tag introduced by us and is handled by GetMandatoryJSONFieldNames. Its intentionally added after two commas because the tag that comes after the first comma should be known by json parser

type TransResponseT

type TransResponseT struct {
	Message             string      `json:"message"`
	DestinationResponse interface{} `json:"destinationResponse"`
	AuthErrorCategory   string      `json:"authErrorCategory"`
}

type TransStatsT

type TransStatsT struct {
	StatTags map[string]string `json:"statTags"`
}

Jump to

Keyboard shortcuts

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