datautils

package
v0.5.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 12 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 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"`
	TriggeredBy TriggeredBy            `json:"triggered_by"`
	Steps       map[string]StepData    `json:"steps,omitempty"`
}

func GetJobRunLookupData

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

func NewJobRunLookupData

func NewJobRunLookupData(input map[string]interface{}, triggeredBy TriggeredBy) JobRunLookupData

func NewJobRunLookupDataFromInputBytes

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

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"`
}

type TriggeredBy

type TriggeredBy string
const (
	TriggeredByEvent    TriggeredBy = "event"
	TriggeredByCron     TriggeredBy = "cron"
	TriggeredBySchedule TriggeredBy = "schedule"
)

Jump to

Keyboard shortcuts

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