transformationdebugger

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithDisableTransformationStatusUploads added in v1.6.0

func WithDisableTransformationStatusUploads(disableTransformationStatusUploads bool) func(h *Handle)

Types

type EventBeforeTransform

type EventBeforeTransform struct {
	EventName  string               `json:"eventName"`
	EventType  string               `json:"eventType"`
	ReceivedAt string               `json:"receivedAt"`
	Payload    types.SingularEventT `json:"payload"`
}

type EventPayloadAfterTransform

type EventPayloadAfterTransform struct {
	EventName string               `json:"eventName"`
	EventType string               `json:"eventType"`
	Payload   types.SingularEventT `json:"payload"`
}

type EventsAfterTransform

type EventsAfterTransform struct {
	ReceivedAt    string                        `json:"receivedAt"`
	IsDropped     bool                          `json:"isDropped"`
	Error         string                        `json:"error"`
	StatusCode    int                           `json:"statusCode"`
	EventPayloads []*EventPayloadAfterTransform `json:"payload"`
}

type Handle added in v1.6.0

type Handle struct {
	// contains filtered or unexported fields
}

func (*Handle) IsUploadEnabled added in v1.6.0

func (h *Handle) IsUploadEnabled(id string) bool

func (*Handle) RecordTransformationStatus added in v1.6.0

func (h *Handle) RecordTransformationStatus(transformStatus *TransformStatusT)

RecordTransformationStatus is used to put the transform event in the eventBatchChannel, which will be processed by handleEvents.

func (*Handle) Stop added in v1.6.0

func (h *Handle) Stop()

func (*Handle) UploadTransformationStatus added in v1.6.0

func (h *Handle) UploadTransformationStatus(tStatus *TransformationStatusT) bool

type Opt added in v1.6.0

type Opt func(*Handle)

type TransformStatusT

type TransformStatusT struct {
	TransformationID string                `json:"transformationId"`
	SourceID         string                `json:"sourceId"`
	DestinationID    string                `json:"destinationId"`
	EventBefore      *EventBeforeTransform `json:"eventBefore"`
	EventsAfter      *EventsAfterTransform `json:"eventsAfter"`
	IsError          bool                  `json:"error"`
}

TransformStatusT is a structure to hold transformation status

type TransformationDebugger added in v1.6.0

type TransformationDebugger interface {
	IsUploadEnabled(id string) bool
	RecordTransformationStatus(transformStatus *TransformStatusT)
	UploadTransformationStatus(tStatus *TransformationStatusT) bool
	Stop()
}

func NewHandle added in v1.6.0

func NewHandle(backendConfig backendconfig.BackendConfig, opts ...Opt) (TransformationDebugger, error)

func NewNoOpService added in v1.6.0

func NewNoOpService() TransformationDebugger

type TransformationStatusT

type TransformationStatusT struct {
	SourceID              string
	DestID                string
	Destination           *backendconfig.DestinationT
	UserTransformedEvents []transformer.TransformerEvent
	EventsByMessageID     map[string]types.SingularEventWithReceivedAt
	FailedEvents          []transformer.TransformerResponse
	UniqueMessageIds      map[string]struct{}
}

func (*TransformationStatusT) Limit added in v1.5.7

func (ts *TransformationStatusT) Limit(
	limit int,
	transformation backendconfig.TransformationT,
) *TransformationStatusT

limit the number of stored events

type TransformationStatusUploader

type TransformationStatusUploader struct {
	// contains filtered or unexported fields
}

func (*TransformationStatusUploader) Transform

func (t *TransformationStatusUploader) Transform(eventBuffer []*TransformStatusT) ([]byte, error)

type UploadT

type UploadT struct {
	Payload []*TransformStatusT `json:"payload"`
}

Jump to

Keyboard shortcuts

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