core

package
v0.0.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arazzo

type Arazzo struct {
	Arazzo             marshaller.Node[string]              `key:"arazzo"`
	Info               marshaller.Node[Info]                `key:"info"`
	SourceDescriptions marshaller.Node[[]SourceDescription] `key:"sourceDescriptions" required:"true"`
	Workflows          marshaller.Node[[]Workflow]          `key:"workflows" required:"true"`
	Components         marshaller.Node[*Components]         `key:"components"`
	Extensions         Extensions                           `key:"extensions"`

	RootNode *yaml.Node
	Config   *yml.Config
}

func Unmarshal

func Unmarshal(ctx context.Context, doc io.Reader) (*Arazzo, error)

func (*Arazzo) Marshal

func (a *Arazzo) Marshal(ctx context.Context, w io.Writer) error

func (*Arazzo) Unmarshal

func (a *Arazzo) Unmarshal(ctx context.Context, node *yaml.Node) error

type Components

type Components struct {
	Inputs         marshaller.Node[*sequencedmap.Map[string, core.JSONSchema]] `key:"inputs"`
	Parameters     marshaller.Node[*sequencedmap.Map[string, Parameter]]       `key:"parameters"`
	SuccessActions marshaller.Node[*sequencedmap.Map[string, SuccessAction]]   `key:"successActions"`
	FailureActions marshaller.Node[*sequencedmap.Map[string, FailureAction]]   `key:"failureActions"`
	Extensions     Extensions                                                  `key:"extensions"`

	RootNode *yaml.Node
}

func (*Components) Unmarshal

func (c *Components) Unmarshal(ctx context.Context, node *yaml.Node) error

type CoreModel

type CoreModel interface {
	Unmarshal(ctx context.Context, node *yaml.Node) error
}

type Criterion

type Criterion struct {
	Context    marshaller.Node[*Expression]        `key:"context"`
	Condition  marshaller.Node[string]             `key:"condition"`
	Type       marshaller.Node[CriterionTypeUnion] `key:"type" required:"false"`
	Extensions Extensions                          `key:"extensions"`

	RootNode *yaml.Node
}

func (*Criterion) Unmarshal

func (c *Criterion) Unmarshal(ctx context.Context, node *yaml.Node) error

type CriterionExpressionType

type CriterionExpressionType struct {
	Type    marshaller.Node[string] `key:"type"`
	Version marshaller.Node[string] `key:"version"`

	RootNode *yaml.Node
}

func (*CriterionExpressionType) Unmarshal

func (c *CriterionExpressionType) Unmarshal(ctx context.Context, node *yaml.Node) error

type CriterionTypeUnion

type CriterionTypeUnion struct {
	Type           *string
	ExpressionType *CriterionExpressionType

	RootNode *yaml.Node
}

func (*CriterionTypeUnion) SyncChanges

func (c *CriterionTypeUnion) SyncChanges(ctx context.Context, model any, valueNode *yaml.Node) (*yaml.Node, error)

func (*CriterionTypeUnion) Unmarshal

func (c *CriterionTypeUnion) Unmarshal(ctx context.Context, node *yaml.Node) error

type Expression

type Expression string

type FailureAction

type FailureAction struct {
	Name       marshaller.Node[string]      `key:"name"`
	Type       marshaller.Node[string]      `key:"type"`
	WorkflowID marshaller.Node[*Expression] `key:"workflowId"`
	StepID     marshaller.Node[*string]     `key:"stepId"`
	RetryAfter marshaller.Node[*float64]    `key:"retryAfter"`
	RetryLimit marshaller.Node[*int]        `key:"retryLimit"`
	Criteria   marshaller.Node[[]Criterion] `key:"criteria"`
	Extensions Extensions                   `key:"extensions"`

	RootNode *yaml.Node
}

func (*FailureAction) Unmarshal

func (f *FailureAction) Unmarshal(ctx context.Context, node *yaml.Node) error

type Info

type Info struct {
	Title       marshaller.Node[string]  `key:"title"`
	Summary     marshaller.Node[*string] `key:"summary"`
	Description marshaller.Node[*string] `key:"description"`
	Version     marshaller.Node[string]  `key:"version"`
	Extensions  Extensions               `key:"extensions"`

	RootNode *yaml.Node
}

func (*Info) Unmarshal

func (i *Info) Unmarshal(ctx context.Context, node *yaml.Node) error

type Outputs

type Outputs = *sequencedmap.Map[string, Expression]

type Parameter

type Parameter struct {
	Name       marshaller.Node[string]            `key:"name"`
	In         marshaller.Node[*string]           `key:"in"`
	Value      marshaller.Node[ValueOrExpression] `key:"value" required:"true"`
	Extensions Extensions                         `key:"extensions"`

	RootNode *yaml.Node
}

func (*Parameter) Unmarshal

func (p *Parameter) Unmarshal(ctx context.Context, node *yaml.Node) error

type PayloadReplacement

type PayloadReplacement struct {
	Target     marshaller.Node[string]            `key:"target"`
	Value      marshaller.Node[ValueOrExpression] `key:"value" required:"true"`
	Extensions Extensions                         `key:"extensions"`

	RootNode *yaml.Node
}

func (*PayloadReplacement) Unmarshal

func (p *PayloadReplacement) Unmarshal(ctx context.Context, node *yaml.Node) error

type RequestBody

type RequestBody struct {
	ContentType  marshaller.Node[*string]              `key:"contentType"`
	Payload      marshaller.Node[ValueOrExpression]    `key:"payload"`
	Replacements marshaller.Node[[]PayloadReplacement] `key:"replacements"`
	Extensions   Extensions                            `key:"extensions"`

	RootNode *yaml.Node
}

func (*RequestBody) Unmarshal

func (r *RequestBody) Unmarshal(ctx context.Context, node *yaml.Node) error

type Reusable

type Reusable[T any] struct {
	Reference marshaller.Node[*Expression] `key:"reference"`
	Value     marshaller.Node[Value]       `key:"value"`
	Object    *T                           `populatorValue:"true"`

	RootNode *yaml.Node
}

func (*Reusable[T]) SyncChanges

func (r *Reusable[T]) SyncChanges(ctx context.Context, model any, valueNode *yaml.Node) (*yaml.Node, error)

func (*Reusable[T]) Unmarshal

func (r *Reusable[T]) Unmarshal(ctx context.Context, node *yaml.Node) error

type SourceDescription

type SourceDescription struct {
	Name       marshaller.Node[string] `key:"name"`
	URL        marshaller.Node[string] `key:"url"`
	Type       marshaller.Node[string] `key:"type"`
	Extensions Extensions              `key:"extensions"`

	RootNode *yaml.Node
}

func (*SourceDescription) Unmarshal

func (s *SourceDescription) Unmarshal(ctx context.Context, node *yaml.Node) error

type Step

type Step struct {
	StepID          marshaller.Node[string]                    `key:"stepId"`
	Description     marshaller.Node[*string]                   `key:"description"`
	OperationID     marshaller.Node[*Expression]               `key:"operationId"`
	OperationPath   marshaller.Node[*string]                   `key:"operationPath"`
	WorkflowID      marshaller.Node[*Expression]               `key:"workflowId"`
	Parameters      marshaller.Node[[]Reusable[Parameter]]     `key:"parameters"`
	RequestBody     marshaller.Node[*RequestBody]              `key:"requestBody"`
	SuccessCriteria marshaller.Node[[]Criterion]               `key:"successCriteria"`
	OnSuccess       marshaller.Node[[]Reusable[SuccessAction]] `key:"onSuccess"`
	OnFailure       marshaller.Node[[]Reusable[FailureAction]] `key:"onFailure"`
	Outputs         marshaller.Node[Outputs]                   `key:"outputs"`
	Extensions      Extensions                                 `key:"extensions"`

	RootNode *yaml.Node
}

func (*Step) Unmarshal

func (s *Step) Unmarshal(ctx context.Context, node *yaml.Node) error

type SuccessAction

type SuccessAction struct {
	Name       marshaller.Node[string]      `key:"name"`
	Type       marshaller.Node[string]      `key:"type"`
	WorkflowID marshaller.Node[*Expression] `key:"workflowId"`
	StepID     marshaller.Node[*string]     `key:"stepId"`
	Criteria   marshaller.Node[[]Criterion] `key:"criteria"`
	Extensions Extensions                   `key:"extensions"`

	RootNode *yaml.Node
}

func (*SuccessAction) Unmarshal

func (s *SuccessAction) Unmarshal(ctx context.Context, node *yaml.Node) error

type Value

type Value = *yaml.Node

type ValueOrExpression

type ValueOrExpression = *yaml.Node

type Workflow

type Workflow struct {
	WorkflowID     marshaller.Node[string]                    `key:"workflowId"`
	Summary        marshaller.Node[*string]                   `key:"summary"`
	Description    marshaller.Node[*string]                   `key:"description"`
	Parameters     marshaller.Node[[]Reusable[Parameter]]     `key:"parameters"`
	Inputs         marshaller.Node[core.JSONSchema]           `key:"inputs"`
	DependsOn      marshaller.Node[[]Expression]              `key:"dependsOn"`
	Steps          marshaller.Node[[]Step]                    `key:"steps" required:"true"`
	SuccessActions marshaller.Node[[]Reusable[SuccessAction]] `key:"successActions"`
	FailureActions marshaller.Node[[]Reusable[FailureAction]] `key:"failureActions"`
	Outputs        marshaller.Node[Outputs]                   `key:"outputs"`
	Extensions     Extensions                                 `key:"extensions"`

	RootNode *yaml.Node
}

func (*Workflow) Unmarshal

func (w *Workflow) Unmarshal(ctx context.Context, node *yaml.Node) error

Jump to

Keyboard shortcuts

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