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 OperatingSystem ¶
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"` }