Documentation
¶
Index ¶
- Constants
- Variables
- func GetTemplateContent(value string) string
- func Is(value string) bool
- func JoinPath(values ...string) (result string)
- func Parse(ctx *broker.Context, path string, name string, value string) (*specs.Property, error)
- func ParseContent(path string, name string, content string) (*specs.Property, error)
- func ParsePropertyReference(value string) *specs.PropertyReference
- func ParseReference(path string, name string, value string) (*specs.Property, error)
- func ResourcePath(resource string, paths ...string) string
- func SplitPath(path string) []string
- type ErrPathNotFound
Constants ¶
View Source
const ( // TemplateOpen tag TemplateOpen = "{{" // TemplateClose tag TemplateClose = "}}" // ReferenceDelimiter represents the value resource reference delimiter ReferenceDelimiter = ":" // PathDelimiter represents the path reference delimiter PathDelimiter = "." // InputResource key InputResource = "input" // OutputResource key OutputResource = "output" // StackResource property StackResource = "stack" // ParamsResource property ParamsResource = "params" // RequestResource property RequestResource = "request" // HeaderResource property HeaderResource = "header" // ResponseResource property ResponseResource = "response" // ErrorResource property ErrorResource = "error" // DefaultInputResource represents the default input property on resource select DefaultInputResource = RequestResource // DefaultCallResource represents the default call property on resource select DefaultCallResource = ResponseResource )
Variables ¶
View Source
var ( // ReferencePattern is the matching pattern for references ReferencePattern = regexp.MustCompile(`^[a-zA-Z0-9_\-\.]*:[a-zA-Z0-9\^\&\%\$@_\-\.]*$`) // StringPattern is the matching pattern for strings StringPattern = regexp.MustCompile(`^\'(.+)\'$`) )
Functions ¶
func GetTemplateContent ¶
GetTemplateContent trims the opening and closing tags from the given template value
func ParseContent ¶
ParseContent parses the given template function
func ParsePropertyReference ¶
func ParsePropertyReference(value string) *specs.PropertyReference
ParsePropertyReference parses the given value to a property reference
func ParseReference ¶
ParseReference parses the given value as a template reference
func ResourcePath ¶
ResourcePath constructs a new path using the given resource and path.
Types ¶
type ErrPathNotFound ¶
type ErrPathNotFound struct {
Path string
}
ErrPathNotFound occurs when path cannot be resolved
func (ErrPathNotFound) Error ¶
func (e ErrPathNotFound) Error() string
Error returns a description of the given error as a string
func (ErrPathNotFound) Prettify ¶
func (e ErrPathNotFound) Prettify() prettyerr.Error
Prettify returns the prettified version of the given error
Click to show internal directories.
Click to hide internal directories.