lookup

package
v2.1.1-0...-182a82a Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const SelfRef = "."

SelfRef represents the syntax used to reference the entire object

Variables

This section is empty.

Functions

func GetAvailableResources

func GetAvailableResources(flow specs.FlowInterface, breakpoint string) map[string]ReferenceMap

GetAvailableResources fetches the available resources able to be referenced until the given breakpoint (call.Name) has been reached.

func GetDefaultProp

func GetDefaultProp(resource string) string

GetDefaultProp returns the default resource for the given resource

func GetNextResource

func GetNextResource(flow specs.FlowInterface, breakpoint string) string

GetNextResource returns the resource after the given breakpoint

func GetReference

func GetReference(path string, prop string, references ReferenceMap) *specs.Property

GetReference attempts to lookup and return the available property on the given path

func GetResourceReference

func GetResourceReference(reference *specs.PropertyReference, references map[string]ReferenceMap, breakpoint string) *specs.Property

GetResourceReference attempts to return the resource reference property

func ParseResource

func ParseResource(resource string) (string, string)

ParseResource parses the given resource into the resource and props

func ResolveSelfReference

func ResolveSelfReference(path string, resource string) string

ResolveSelfReference appends the given resource if the path is a self reference

Types

type PathLookup

type PathLookup func(path string) *specs.Property

PathLookup represents a lookup method that returns the property available on the given path

func HeaderLookup

func HeaderLookup(header specs.Header) PathLookup

HeaderLookup attempts to lookup the given path inside the header

func OnErrLookup

func OnErrLookup(node string, spec *specs.OnError) PathLookup

OnErrLookup constructs a lookup method able to lookup error references

func ParamsLookup

func ParamsLookup(params map[string]*specs.Property, flow specs.FlowInterface, breakpoint string) PathLookup

ParamsLookup constructs a lookup method able to lookup property references inside the given params map

func PropertyLookup

func PropertyLookup(param *specs.Property) PathLookup

PropertyLookup attempts to lookup the given path inside the params collection

func VariableHeaderLookup

func VariableHeaderLookup(header specs.Header) PathLookup

VariableHeaderLookup returns a string property for the given path and sets the header property

type ReferenceMap

type ReferenceMap map[string]PathLookup

ReferenceMap holds the resource references and their representing parameter map

Jump to

Keyboard shortcuts

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