transform

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package transform is the native/default implementation of a transform provider. It is made externally accessible since it's useful for developing/testing extractor/loader plug-ins.

It is currently not yet possible to provide custom transform providers/plug-ins, in contrast to source/sink ones. Client-provided custom transformation logic can instead be added via the pre-transform hook function.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Browser

type Browser struct {
	Name          string `json:"name"`
	Version       string `json:"version"`
	Engine        string `json:"engine"`
	EngineVersion string `json:"engineVersion"`
}

type OperatingSystem

type OperatingSystem struct {
	Name     string `json:"name"`
	FullName string `json:"fullName"`
	Version  string `json:"version"`
}

type Transformer

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

Default Transformer implementation (stateless, immutable). This is currently the only implementation and supports all transformation types available in a GEIST spec. Future custom transformer implementations are easily added through this mechanism.

func NewTransformer

func NewTransformer(spec *entity.Spec) *Transformer

func (*Transformer) Transform

func (t *Transformer) Transform(
	ctx context.Context,
	event []byte,
	retryable *bool) ([]*entity.Transformed, error)

Transform returns a key-value map, based on input event data and the transformation rules in the Spec, where keys are "id" fields from Transform spec, and values are the transformation results. The output from Transform() can contain multiple new events, in case of applied event-split transformations. If Transform() succeeded, but the transformation resulted in no output, e.g. for non-applicable incoming events, the return values are nil, nil (i.e., not regarded as an error).

type UserAgent

type UserAgent struct {
	Platform        string          `json:"platform"`
	OperatingSystem OperatingSystem `json:"operatingSystem"`
	Localization    string          `json:"localization"`
	Browser         Browser         `json:"browser"`
	Bot             bool            `json:"bot"`
	Mobile          bool            `json:"mobile"`
}

func NewUserAgent

func NewUserAgent(uaString string) (UserAgent, error)

func (UserAgent) String

func (u UserAgent) String() string

Jump to

Keyboard shortcuts

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