transform

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package transform runs MIMIRO transform scripts (TypeScript or JavaScript) against a hub via esbuild + goja.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogEntry

type LogEntry struct {
	Level     string    `json:"level"`
	Message   string    `json:"message"`
	Timestamp time.Time `json:"ts"`
}

type Logger

type Logger interface {
	Log(entry LogEntry)
}

type Options

type Options struct {
	HubURL  string
	Bearer  string
	Logger  Logger
	Timeout time.Duration
}

type Result

type Result struct {
	Entities   []*api.Entity `json:"entities"`
	Logs       []LogEntry    `json:"logs"`
	DurationMs int64         `json:"durationMs"`
}

Compile and runtime errors surface as level=error entries on Logs with empty Entities; the error return is reserved for cancellation / timeout.

func Run

func Run(ctx context.Context, source string, entities []*api.Entity, opts Options) (*Result, error)

Jump to

Keyboard shortcuts

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