Documentation
¶
Index ¶
- Variables
- func AddUnresolvableErrorsTo[T ref.ID[T]](to *UnresolvableError, from *ref.Log[T])
- func NewEvaluator(opts ...Option) evaluate.Evaluator[*References]
- func ParseFile(name string) (any, error)
- func ParseJSON(r io.Reader) (any, error)
- func ParseJSONString(data string) (any, error)
- func ParseYAML(r io.Reader) (any, error)
- func ParseYAMLNode(node *yaml.Node) (any, error)
- func ParseYAMLString(data string) (any, error)
- type AnswerID
- type AnswerMappingTypeResolver
- type AnswerTypeResolver
- type ConnectionID
- type ConnectionMappingTypeResolver
- type ConnectionTemplateEnvironment
- type ConnectionTypeResolver
- type DataID
- type DataMappingTypeResolver
- type DataQueryError
- type DataResolverNotFoundError
- type DataTemplateEnvironment
- type DataTypeResolver
- type FieldNotFoundError
- type JSONTree
- type MemoryAnswerKey
- type MemoryAnswerTypeResolver
- type MemoryConnectionKey
- type MemoryConnectionTypeResolver
- func (mr *MemoryConnectionTypeResolver) ResolveAllConnections(ctx context.Context) (map[string]map[string]any, error)
- func (mr *MemoryConnectionTypeResolver) ResolveConnection(ctx context.Context, connectionType, name string) (any, error)
- func (mr *MemoryConnectionTypeResolver) ResolveTypeOfConnections(ctx context.Context, connectionType string) (map[string]any, error)
- type MemoryDataTypeResolver
- type MemoryOutputKey
- type MemoryOutputTypeResolver
- func (mr *MemoryOutputTypeResolver) ResolveAllOutputs(ctx context.Context) (map[string]map[string]any, error)
- func (mr *MemoryOutputTypeResolver) ResolveOutput(ctx context.Context, from, name string) (any, error)
- func (mr *MemoryOutputTypeResolver) ResolveStepOutputs(ctx context.Context, from string) (map[string]any, error)
- type MemoryParameterTypeResolver
- type MemorySecretTypeResolver
- type MemoryStatusKey
- type MemoryStatusTypeResolver
- type Option
- type Options
- type OutputID
- type OutputMappingTypeResolver
- type OutputTemplateEnvironment
- type OutputTypeResolver
- type ParameterID
- type ParameterMappingTypeResolver
- type ParameterTemplateEnvironment
- type ParameterTypeResolver
- type References
- type SecretID
- type SecretMappingTypeResolver
- type SecretTemplateEnvironment
- type SecretTypeResolver
- type StatusID
- type StatusTemplateEnvironment
- type StatusTypeResolver
- type UnresolvableError
- type WithAnswerTypeResolver
- type WithConnectionTypeResolver
- type WithDataTypeResolver
- type WithOutputTypeResolver
- type WithParameterTypeResolver
- type WithSecretTypeResolver
- type WithStatusTypeResolver
- type YAMLAnswerTransformer
- type YAMLBinaryToEncodingTransformer
- type YAMLConnectionTransformer
- type YAMLDataTransformer
- type YAMLInvocationTransformer
- type YAMLOutputTransformer
- type YAMLParameterTransformer
- type YAMLSecretTransformer
- type YAMLTransformer
- type YAMLTree
- type YAMLUnknownTagTransformer
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("not found")
)
View Source
var YAMLTransformers = []YAMLTransformer{ YAMLDataTransformer{}, YAMLSecretTransformer{}, YAMLConnectionTransformer{}, YAMLOutputTransformer{}, YAMLParameterTransformer{}, YAMLAnswerTransformer{}, YAMLInvocationTransformer{}, YAMLBinaryToEncodingTransformer{}, YAMLUnknownTagTransformer{}, }
Functions ¶
func AddUnresolvableErrorsTo ¶
func AddUnresolvableErrorsTo[T ref.ID[T]](to *UnresolvableError, from *ref.Log[T])
func NewEvaluator ¶
func NewEvaluator(opts ...Option) evaluate.Evaluator[*References]
func ParseJSONString ¶
func ParseYAMLNode ¶
func ParseYAMLString ¶
Types ¶
type AnswerMappingTypeResolver ¶
type AnswerMappingTypeResolver struct {
AnswerTypeResolver
}
func (*AnswerMappingTypeResolver) ResolveMappingType ¶
func (amtr *AnswerMappingTypeResolver) ResolveMappingType(ctx context.Context, tm map[string]any) (*evaluate.Result[*References], error)
type AnswerTypeResolver ¶
type AnswerTypeResolver interface {
ResolveAnswer(ctx context.Context, askRef, name string) (any, error)
}
var NoOpAnswerTypeResolver AnswerTypeResolver = NewMemoryAnswerTypeResolver(map[MemoryAnswerKey]any{})
type ConnectionID ¶
func (ConnectionID) Less ¶
func (ci ConnectionID) Less(other ConnectionID) bool
func (ConnectionID) String ¶
func (ci ConnectionID) String() string
type ConnectionMappingTypeResolver ¶
type ConnectionMappingTypeResolver struct {
ConnectionTypeResolver
}
func (*ConnectionMappingTypeResolver) ResolveMappingType ¶
func (cmtr *ConnectionMappingTypeResolver) ResolveMappingType(ctx context.Context, tm map[string]any) (*evaluate.Result[*References], error)
type ConnectionTemplateEnvironment ¶
type ConnectionTemplateEnvironment struct {
ConnectionTypeResolver
}
func (*ConnectionTemplateEnvironment) Expand ¶
func (cte *ConnectionTemplateEnvironment) Expand(ctx context.Context, depth int) (*evaluate.Result[*References], error)
type ConnectionTypeResolver ¶
type ConnectionTypeResolver interface { ResolveAllConnections(ctx context.Context) (map[string]map[string]any, error) ResolveTypeOfConnections(ctx context.Context, connectionType string) (map[string]any, error) ResolveConnection(ctx context.Context, connectionType, name string) (any, error) }
var NoOpConnectionTypeResolver ConnectionTypeResolver = NewMemoryConnectionTypeResolver(map[MemoryConnectionKey]any{})
type DataMappingTypeResolver ¶
type DataMappingTypeResolver map[string]DataTypeResolver
func (DataMappingTypeResolver) ResolveMappingType ¶
func (dmtr DataMappingTypeResolver) ResolveMappingType(ctx context.Context, tm map[string]any) (*evaluate.Result[*References], error)
type DataQueryError ¶
func (*DataQueryError) Error ¶
func (e *DataQueryError) Error() string
func (*DataQueryError) Unwrap ¶
func (e *DataQueryError) Unwrap() error
type DataResolverNotFoundError ¶
type DataResolverNotFoundError struct {
Name string
}
func (*DataResolverNotFoundError) Error ¶
func (e *DataResolverNotFoundError) Error() string
type DataTemplateEnvironment ¶
type DataTemplateEnvironment struct { DataTypeResolver Name string }
func (*DataTemplateEnvironment) Expand ¶
func (dte *DataTemplateEnvironment) Expand(ctx context.Context, depth int) (*evaluate.Result[*References], error)
type DataTypeResolver ¶
var NoOpDataTypeResolver DataTypeResolver = &noOpDataTypeResolver{}
type FieldNotFoundError ¶
type FieldNotFoundError struct {
Name string
}
func (*FieldNotFoundError) Error ¶
func (e *FieldNotFoundError) Error() string
type JSONTree ¶
type JSONTree struct {
Tree any
}
func (JSONTree) MarshalJSON ¶
func (*JSONTree) UnmarshalJSON ¶
type MemoryAnswerKey ¶
type MemoryAnswerTypeResolver ¶
type MemoryAnswerTypeResolver struct {
// contains filtered or unexported fields
}
func NewMemoryAnswerTypeResolver ¶
func NewMemoryAnswerTypeResolver(m map[MemoryAnswerKey]any) *MemoryAnswerTypeResolver
func (*MemoryAnswerTypeResolver) ResolveAnswer ¶
type MemoryConnectionKey ¶
type MemoryConnectionTypeResolver ¶
type MemoryConnectionTypeResolver struct {
// contains filtered or unexported fields
}
func NewMemoryConnectionTypeResolver ¶
func NewMemoryConnectionTypeResolver(m map[MemoryConnectionKey]any) *MemoryConnectionTypeResolver
func (*MemoryConnectionTypeResolver) ResolveAllConnections ¶
func (*MemoryConnectionTypeResolver) ResolveConnection ¶
func (*MemoryConnectionTypeResolver) ResolveTypeOfConnections ¶
type MemoryDataTypeResolver ¶
type MemoryDataTypeResolver struct {
// contains filtered or unexported fields
}
func NewMemoryDataTypeResolver ¶
func NewMemoryDataTypeResolver(value any) *MemoryDataTypeResolver
func (*MemoryDataTypeResolver) ResolveData ¶
func (mr *MemoryDataTypeResolver) ResolveData(ctx context.Context) (any, error)
type MemoryOutputKey ¶
type MemoryOutputTypeResolver ¶
type MemoryOutputTypeResolver struct {
// contains filtered or unexported fields
}
func NewMemoryOutputTypeResolver ¶
func NewMemoryOutputTypeResolver(m map[MemoryOutputKey]any) *MemoryOutputTypeResolver
func (*MemoryOutputTypeResolver) ResolveAllOutputs ¶
func (*MemoryOutputTypeResolver) ResolveOutput ¶
func (*MemoryOutputTypeResolver) ResolveStepOutputs ¶
type MemoryParameterTypeResolver ¶
type MemoryParameterTypeResolver struct {
// contains filtered or unexported fields
}
func NewMemoryParameterTypeResolver ¶
func NewMemoryParameterTypeResolver(m map[string]any) *MemoryParameterTypeResolver
func (*MemoryParameterTypeResolver) ResolveAllParameters ¶
func (*MemoryParameterTypeResolver) ResolveParameter ¶
type MemorySecretTypeResolver ¶
type MemorySecretTypeResolver struct {
// contains filtered or unexported fields
}
func NewMemorySecretTypeResolver ¶
func NewMemorySecretTypeResolver(m map[string]string) *MemorySecretTypeResolver
func (*MemorySecretTypeResolver) ResolveAllSecrets ¶
func (*MemorySecretTypeResolver) ResolveSecret ¶
type MemoryStatusKey ¶
type MemoryStatusTypeResolver ¶
type MemoryStatusTypeResolver struct {
// contains filtered or unexported fields
}
func NewMemoryStatusTypeResolver ¶
func NewMemoryStatusTypeResolver(m map[MemoryStatusKey]bool) *MemoryStatusTypeResolver
func (*MemoryStatusTypeResolver) ResolveStatus ¶
type Options ¶
type Options struct { DataTypeResolvers map[string]DataTypeResolver SecretTypeResolver SecretTypeResolver ConnectionTypeResolver ConnectionTypeResolver OutputTypeResolver OutputTypeResolver ParameterTypeResolver ParameterTypeResolver AnswerTypeResolver AnswerTypeResolver StatusTypeResolver StatusTypeResolver }
func (*Options) ApplyOptions ¶
type OutputMappingTypeResolver ¶
type OutputMappingTypeResolver struct {
OutputTypeResolver
}
func (*OutputMappingTypeResolver) ResolveMappingType ¶
func (omtr *OutputMappingTypeResolver) ResolveMappingType(ctx context.Context, tm map[string]any) (*evaluate.Result[*References], error)
type OutputTemplateEnvironment ¶
type OutputTemplateEnvironment struct {
OutputTypeResolver
}
func (*OutputTemplateEnvironment) Expand ¶
func (ote *OutputTemplateEnvironment) Expand(ctx context.Context, depth int) (*evaluate.Result[*References], error)
type OutputTypeResolver ¶
type OutputTypeResolver interface { ResolveAllOutputs(ctx context.Context) (map[string]map[string]any, error) ResolveStepOutputs(ctx context.Context, from string) (map[string]any, error) ResolveOutput(ctx context.Context, from, name string) (any, error) }
var NoOpOutputTypeResolver OutputTypeResolver = NewMemoryOutputTypeResolver(map[MemoryOutputKey]any{})
type ParameterID ¶
type ParameterID struct {
Name string `json:"name"`
}
func (ParameterID) Less ¶
func (pi ParameterID) Less(other ParameterID) bool
func (ParameterID) String ¶
func (pi ParameterID) String() string
type ParameterMappingTypeResolver ¶
type ParameterMappingTypeResolver struct {
ParameterTypeResolver
}
func (*ParameterMappingTypeResolver) ResolveMappingType ¶
func (pmtr *ParameterMappingTypeResolver) ResolveMappingType(ctx context.Context, tm map[string]any) (*evaluate.Result[*References], error)
type ParameterTemplateEnvironment ¶
type ParameterTemplateEnvironment struct {
ParameterTypeResolver
}
func (*ParameterTemplateEnvironment) Expand ¶
func (pte *ParameterTemplateEnvironment) Expand(ctx context.Context, depth int) (*evaluate.Result[*References], error)
type ParameterTypeResolver ¶
type ParameterTypeResolver interface { ResolveAllParameters(ctx context.Context) (map[string]any, error) ResolveParameter(ctx context.Context, name string) (any, error) }
var NoOpParameterTypeResolver ParameterTypeResolver = NewMemoryParameterTypeResolver(map[string]any{})
type References ¶
type References struct { Data *ref.Log[DataID] Secrets *ref.Log[SecretID] Connections *ref.Log[ConnectionID] Outputs *ref.Log[OutputID] Parameters *ref.Log[ParameterID] Answers *ref.Log[AnswerID] Statuses *ref.Log[StatusID] }
func CopyReferences ¶
func CopyReferences(from *References) *References
func InitialReferences ¶
func InitialReferences(fn func(r *References)) *References
func NewReferences ¶
func NewReferences() *References
func (*References) Merge ¶
func (r *References) Merge(others ...*References) *References
func (*References) OK ¶
func (r *References) OK() bool
func (*References) Resolved ¶
func (r *References) Resolved() bool
func (*References) SetUsed ¶
func (r *References) SetUsed(flag bool)
func (*References) ToError ¶
func (r *References) ToError() *UnresolvableError
func (*References) Used ¶
func (r *References) Used() bool
type SecretMappingTypeResolver ¶
type SecretMappingTypeResolver struct {
SecretTypeResolver
}
func (*SecretMappingTypeResolver) ResolveMappingType ¶
func (smtr *SecretMappingTypeResolver) ResolveMappingType(ctx context.Context, tm map[string]any) (*evaluate.Result[*References], error)
type SecretTemplateEnvironment ¶
type SecretTemplateEnvironment struct {
SecretTypeResolver
}
func (*SecretTemplateEnvironment) Expand ¶
func (ste *SecretTemplateEnvironment) Expand(ctx context.Context, depth int) (*evaluate.Result[*References], error)
type SecretTypeResolver ¶
type SecretTypeResolver interface { ResolveAllSecrets(ctx context.Context) (map[string]string, error) ResolveSecret(ctx context.Context, name string) (string, error) }
var NoOpSecretTypeResolver SecretTypeResolver = NewMemorySecretTypeResolver(map[string]string{})
type StatusTemplateEnvironment ¶
type StatusTemplateEnvironment struct {
StatusTypeResolver
}
func (*StatusTemplateEnvironment) Expand ¶
func (ste *StatusTemplateEnvironment) Expand(ctx context.Context, depth int) (*evaluate.Result[*References], error)
type StatusTypeResolver ¶
type StatusTypeResolver interface {
ResolveStatus(ctx context.Context, name, property string) (bool, error)
}
var NoOpStatusTypeResolver StatusTypeResolver = NewMemoryStatusTypeResolver(map[MemoryStatusKey]bool{})
type UnresolvableError ¶
type UnresolvableError struct {
Causes []error
}
func (*UnresolvableError) Error ¶
func (e *UnresolvableError) Error() string
type WithAnswerTypeResolver ¶
type WithAnswerTypeResolver struct{ AnswerTypeResolver }
func (WithAnswerTypeResolver) ApplyToOptions ¶
func (watr WithAnswerTypeResolver) ApplyToOptions(target *Options)
type WithConnectionTypeResolver ¶
type WithConnectionTypeResolver struct{ ConnectionTypeResolver }
func (WithConnectionTypeResolver) ApplyToOptions ¶
func (wctr WithConnectionTypeResolver) ApplyToOptions(target *Options)
type WithDataTypeResolver ¶
type WithDataTypeResolver struct { Name string Default bool DataTypeResolver DataTypeResolver }
func (WithDataTypeResolver) ApplyToOptions ¶
func (wdtr WithDataTypeResolver) ApplyToOptions(target *Options)
type WithOutputTypeResolver ¶
type WithOutputTypeResolver struct{ OutputTypeResolver }
func (WithOutputTypeResolver) ApplyToOptions ¶
func (wotr WithOutputTypeResolver) ApplyToOptions(target *Options)
type WithParameterTypeResolver ¶
type WithParameterTypeResolver struct{ ParameterTypeResolver }
func (WithParameterTypeResolver) ApplyToOptions ¶
func (wptr WithParameterTypeResolver) ApplyToOptions(target *Options)
type WithSecretTypeResolver ¶
type WithSecretTypeResolver struct{ SecretTypeResolver }
func (WithSecretTypeResolver) ApplyToOptions ¶
func (wstr WithSecretTypeResolver) ApplyToOptions(target *Options)
type WithStatusTypeResolver ¶
type WithStatusTypeResolver struct{ StatusTypeResolver }
func (WithStatusTypeResolver) ApplyToOptions ¶
func (wstr WithStatusTypeResolver) ApplyToOptions(target *Options)
type YAMLAnswerTransformer ¶
type YAMLAnswerTransformer struct{}
func (YAMLAnswerTransformer) Transform ¶
func (YAMLAnswerTransformer) Transform(node *yaml.Node) (bool, error)
type YAMLBinaryToEncodingTransformer ¶
type YAMLBinaryToEncodingTransformer struct{}
func (YAMLBinaryToEncodingTransformer) Transform ¶
func (YAMLBinaryToEncodingTransformer) Transform(node *yaml.Node) (bool, error)
type YAMLConnectionTransformer ¶
type YAMLConnectionTransformer struct{}
func (YAMLConnectionTransformer) Transform ¶
func (YAMLConnectionTransformer) Transform(node *yaml.Node) (bool, error)
type YAMLDataTransformer ¶
type YAMLDataTransformer struct{}
func (YAMLDataTransformer) Transform ¶
func (YAMLDataTransformer) Transform(node *yaml.Node) (bool, error)
type YAMLInvocationTransformer ¶
type YAMLInvocationTransformer struct{}
func (YAMLInvocationTransformer) Transform ¶
func (YAMLInvocationTransformer) Transform(node *yaml.Node) (bool, error)
type YAMLOutputTransformer ¶
type YAMLOutputTransformer struct{}
func (YAMLOutputTransformer) Transform ¶
func (YAMLOutputTransformer) Transform(node *yaml.Node) (bool, error)
type YAMLParameterTransformer ¶
type YAMLParameterTransformer struct{}
func (YAMLParameterTransformer) Transform ¶
func (YAMLParameterTransformer) Transform(node *yaml.Node) (bool, error)
type YAMLSecretTransformer ¶
type YAMLSecretTransformer struct{}
func (YAMLSecretTransformer) Transform ¶
func (YAMLSecretTransformer) Transform(node *yaml.Node) (bool, error)
type YAMLTransformer ¶
type YAMLTree ¶
type YAMLTree struct {
Tree any
}
func (YAMLTree) MarshalYAML ¶
func (*YAMLTree) UnmarshalYAML ¶
type YAMLUnknownTagTransformer ¶
type YAMLUnknownTagTransformer struct{}
func (YAMLUnknownTagTransformer) Transform ¶
func (YAMLUnknownTagTransformer) Transform(node *yaml.Node) (bool, error)
Click to show internal directories.
Click to hide internal directories.