transformer

package
v0.46.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: AGPL-3.0 Imports: 13 Imported by: 1

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

Types

type Option added in v0.44.0

type Option func(*config)

func WithConfigBackendURL

func WithConfigBackendURL(url string) Option

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() Option

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) Option

func WithDockerNetwork added in v0.43.0

func WithDockerNetwork(network *docker.Network) Option

func WithEnv added in v0.44.0

func WithEnv(env string) Option

func WithRepository added in v0.44.0

func WithRepository(repository string) Option

func WithUserTransformations added in v0.22.0

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

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;
									}`,
		})

type Resource

type Resource struct {
	TransformerURL string
}

func Setup

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

Jump to

Keyboard shortcuts

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