transformctx

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: MIT Imports: 1 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ctx

type Ctx struct {
	// InputName is the name of the input stream to be ingested and transformed.
	// Most of the time there is no need for caller of NewTransform to set it, it will be auto-set
	// by omniparser.
	InputName string
	// ExternalProperties contains externally set string properties used by `external` transform
	// in a schema.
	ExternalProperties map[string]string
	// CtxAwareErr allows context aware error formatting such as adding input (file) name
	// and line number as a prefix to the error string. Most of the time there is no need for caller
	// of NewTransform to set it, it will be auto-set by omniparser.
	CtxAwareErr errs.CtxAwareErr
	// CustomParam lets caller of NewTransform set a custom parameter they see fit, and this custom
	// param will be passed along with the Ctx object throughout all the stages and operations of
	// a transform, including passing to all the `custom_func` and `custom_parse`.
	CustomParam interface{}
}

Ctx is the context object used throughout a Transform operation.

func (*Ctx) External

func (ctx *Ctx) External(name string) (string, bool)

External looks up, and returns an external property value, if exists.

Jump to

Keyboard shortcuts

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