Documentation ¶
Index ¶
- Variables
- func EachFile(kind string, libdirs []string, cb func(name string, path string) (br bool))
- func ValToDDLType(typedef string, val string) (res interface{}, err error)
- type InputItem
- func (i *InputItem) ConvertStringValue(val string) (interface{}, error)
- func (i *InputItem) RenderConsole() ([]byte, error)
- func (i *InputItem) RenderMarkdown() ([]byte, error)
- func (i *InputItem) Required() bool
- func (i *InputItem) ValidateStringValue(val string) (converted interface{}, warnings []string, err error)
- func (i *InputItem) ValidateValue(val interface{}) (warnings []string, err error)
- type OutputItem
Constants ¶
This section is empty.
Variables ¶
View Source
var ( InputTypeArray = "Array" InputTypeBoolean = "boolean" InputTypeFloat = "float" InputTypeHash = "Hash" InputTypeInteger = "integer" InputTypeList = "list" InputTypeNumber = "number" InputTypeString = "string" InputTypeAny = "" )
View Source
var ( OutputTypeArray = "Array" OutputTypeBoolean = "boolean" OutputTypeFloat = "float" OutputTypeHash = "Hash" OutputTypeInteger = "integer" OutputTypeList = "list" OutputTypeNumber = "number" OutputTypeString = "string" OutputTypeAny = "" )
Functions ¶
func EachFile ¶
EachFile calls cb with a path to every found DD of type kind, stops looking when br is true
func ValToDDLType ¶
ValToDDLType converts val into the type described in typedef where typedef is a typical choria DDL supported type
Types ¶
type InputItem ¶
type InputItem struct { Prompt string `json:"prompt"` Description string `json:"description"` Type string `json:"type"` Default interface{} `json:"default,omitempty"` Optional bool `json:"optional"` Validation string `json:"validation,omitempty"` MaxLength int `json:"maxlength,omitempty"` Enum []string `json:"list,omitempty"` }
InputItem describes an individual input item
func (*InputItem) ConvertStringValue ¶
ConvertStringValue converts a string representing value into the correct type according to the input Type
func (*InputItem) RenderConsole ¶ added in v0.22.0
func (*InputItem) RenderMarkdown ¶ added in v0.22.0
func (*InputItem) ValidateStringValue ¶
func (i *InputItem) ValidateStringValue(val string) (converted interface{}, warnings []string, err error)
ValidateStringValue converts a value to the appropriate type for this input then validates it
func (*InputItem) ValidateValue ¶
ValidateValue validates a value against this input, should be of the right data type already. See ValToDDLType()
type OutputItem ¶
type OutputItem struct { Description string `json:"description"` DisplayAs string `json:"display_as"` Default interface{} `json:"default,omitempty"` Type string `json:"type,omitempty"` }
OutputItem describes an individual output item
func (*OutputItem) RenderConsole ¶ added in v0.22.0
func (i *OutputItem) RenderConsole() ([]byte, error)
func (*OutputItem) RenderMarkdown ¶ added in v0.22.0
func (i *OutputItem) RenderMarkdown() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.