Documentation ¶
Index ¶
- Variables
- func EachFile(kind string, libdirs []string, cb func(name string, path string) (br bool))
- func ValToDDLType(typedef string, val string) (res any, err error)
- type InputItem
- func (i *InputItem) ConvertStringValue(val string) (any, 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 any, warnings []string, err error)
- func (i *InputItem) ValidateValue(val any) (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 ¶
Types ¶
type InputItem ¶
type InputItem struct { Prompt string `json:"prompt"` Description string `json:"description"` Type string `json:"type"` Default any `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 ¶
ValidateStringValue converts a value to the appropriate type for this input then validates it
type OutputItem ¶
type OutputItem struct { Description string `json:"description"` DisplayAs string `json:"display_as"` Default any `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.