Documentation
¶
Index ¶
Constants ¶
const ( UserTransformerStage = "user_transformer" DestTransformerStage = "dest_transformer" )
Variables ¶
This section is empty.
Functions ¶
func GetVersion ¶
func GetVersion() (transformerBuildVersion string)
GetVersion gets the transformer version by asking it on /transfomerBuildVersion. if there is any error it returns empty string
Types ¶
type HandleT ¶
type HandleT struct {
// contains filtered or unexported fields
}
HandleT is the handle for this class
func (*HandleT) Transform ¶
func (trans *HandleT) Transform(clientEvents []TransformerEventT, url string, batchSize int) ResponseT
Transform function is used to invoke transformer API Transformer is not thread safe. If performance becomes an issue we can create multiple transformer instances but given that they are hitting the same NodeJS process it may not be an issue if batch sizes (len clientEvents) are big enough to saturate NodeJS. Right now the transformer instance is shared between both user specific transformation code and destination transformation code.
type MetadataT ¶
type MetadataT struct { SourceID string `json:"sourceId"` WorkspaceID string `json:"workspaceId"` Namespace string `json:"namespace"` InstanceID string `json:"instanceId"` SourceType string `json:"sourceType"` SourceCategory string `json:"sourceCategory"` DestinationID string `json:"destinationId"` JobRunID string `json: "jobRunId"` JobID int64 `json:"jobId"` SourceBatchID string `json:"sourceBatchId"` SourceJobID string `json:"sourceJobId"` SourceJobRunID string `json:"sourceJobRunId"` SourceTaskID string `json:"sourceTaskId"` SourceTaskRunID string `json:"sourceTaskRunId"` DestinationType string `json:"destinationType"` MessageID string `json:"messageId"` // set by user_transformer to indicate transformed event is part of group indicated by messageIDs MessageIDs []string `json:"messageIds"` RudderID string `json:"rudderId"` SessionID string `json:"sessionId,omitempty"` ReceivedAt string `json:"receivedAt"` EventName string `json:"eventName"` EventType string `json:"eventType"` }
type ResponseT ¶
type ResponseT struct { Events []TransformerResponseT FailedEvents []TransformerResponseT }
ResponseT represents a Transformer response
type Transformer ¶
type Transformer interface { Setup() Transform(clientEvents []TransformerEventT, url string, batchSize int) ResponseT }
Transformer provides methods to transform events
type TransformerEventT ¶
type TransformerEventT struct { Message types.SingularEventT `json:"message"` Metadata MetadataT `json:"metadata"` Destination backendconfig.DestinationT `json:"destination"` SessionID string `json:"session_id,omitempty"` Libraries []backendconfig.LibraryT `json:"libraries"` }