datautils

package
v0.4.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddStepOutput

func AddStepOutput(data *types.JSON, stepReadableId string, stepOutput []byte) (*types.JSON, error)

func FromJSONType

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

func MergeMaps

func MergeMaps(maps ...map[string]interface{}) map[string]interface{}

MergeMaps merges any number of maps together, with maps later in the slice taking precedent

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"`
	Steps map[string]stepLookupData `json:"steps,omitempty"`
}

func GetJobRunLookupData

func GetJobRunLookupData(data *types.JSON) (JobRunLookupData, error)

func NewJobRunLookupData

func NewJobRunLookupData(input map[string]interface{}, rawInput []byte) JobRunLookupData

func NewJobRunLookupDataFromInputBytes

func NewJobRunLookupDataFromInputBytes(input []byte) (JobRunLookupData, error)

Jump to

Keyboard shortcuts

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