transformer

package
v0.32.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTransformerBackendConfigHandler added in v0.23.2

func NewTransformerBackendConfigHandler(transformations map[string]string) http.Handler

NewTransformerBackendConfigHandler returns http request handler to handle all backend config requests by transformer

func WithConfigBackendURL

func WithConfigBackendURL(url string) func(*config)

WithConfigBackendURL lets transformer use custom backend config server for transformations WithConfigBackendURL should not be used with WithUserTransformations option

func WithConnectionToHostEnabled added in v0.23.2

func WithConnectionToHostEnabled() func(*config)

WithConnectionToHostEnabled lets transformer container connect with the host machine i.e. transformer container will be able to access localhost of the host machine

func WithDockerImageTag

func WithDockerImageTag(tag string) func(*config)

func WithUserTransformations added in v0.22.0

func WithUserTransformations(transformations map[string]string, cleaner resource.Cleaner) func(*config)

WithUserTransformations will mock BE config to set transformation for given transformation versionID to transformation function map

- events with transformationVersionID not present in map will not be transformed and transformer will return 404 for those requests

- WithUserTransformations should not be used with WithConfigBackendURL option

- only javascript transformation functions are supported

e.g.

WithUserTransformations(map[string]string{
			"transform-version-id-1": `export function transformEvent(event, metadata) {
										event.transformed=true
										return event;
									}`,
		})

Types

type Resource

type Resource struct {
	TransformerURL string
	Port           string
}

func Setup

func Setup(pool *dockertest.Pool, d resource.Cleaner, opts ...func(conf *config)) (*Resource, error)

Jump to

Keyboard shortcuts

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