datautils

package
v0.32.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromJSONType

func FromJSONType(data *types.JSON, target interface{}) error

func JSONBytesToMap added in v0.14.1

func JSONBytesToMap(jsonBytes []byte) (map[string]interface{}, error)

func RenderTemplateFields

func RenderTemplateFields(data map[string]interface{}, input map[string]interface{}) (map[string]interface{}, error)

RenderTemplateFields recursively processes the input map, rendering any string fields using the data map.

func ToJSONMap

func ToJSONMap(data interface{}) (map[string]interface{}, error)

func ToJSONType

func ToJSONType(data interface{}) (*types.JSON, error)

Types

type DataDecoderValidator

type DataDecoderValidator interface {
	DecodeAndValidate(input, target interface{}) error
}

func NewDataDecoderValidator

func NewDataDecoderValidator(
	f ...DataDecoderValidatorOpt,
) DataDecoderValidator

type DataDecoderValidatorOpt

type DataDecoderValidatorOpt func(*DataDecoderValidatorOpts)

func WithTagName

func WithTagName(t string) DataDecoderValidatorOpt

type DataDecoderValidatorOpts

type DataDecoderValidatorOpts struct {
	// contains filtered or unexported fields
}

type DefaultDataDecoderValidator

type DefaultDataDecoderValidator struct {
	// contains filtered or unexported fields
}

func (*DefaultDataDecoderValidator) DecodeAndValidate

func (j *DefaultDataDecoderValidator) DecodeAndValidate(input, target interface{}) error

type JobRunLookupData

type JobRunLookupData struct {
	Input       map[string]interface{} `json:"input"`
	TriggeredBy TriggeredBy            `json:"triggered_by"`
	Steps       map[string]StepData    `json:"steps,omitempty"`
}

type StepData

type StepData map[string]interface{}

type StepRunData

type StepRunData struct {
	Input       map[string]interface{} `json:"input"`
	TriggeredBy TriggeredBy            `json:"triggered_by"`
	Parents     map[string]StepData    `json:"parents"`

	// custom-set user data for the step
	UserData map[string]interface{} `json:"user_data"`

	// overrides set from the playground
	Overrides map[string]interface{} `json:"overrides"`
}

type TriggeredBy

type TriggeredBy string
const (
	TriggeredByEvent    TriggeredBy = "event"
	TriggeredByCron     TriggeredBy = "cron"
	TriggeredBySchedule TriggeredBy = "schedule"
	TriggeredByManual   TriggeredBy = "manual"
	TriggeredByParent   TriggeredBy = "parent"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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