Documentation
¶
Overview ¶
Package prompts provides interactive terminal prompts for CLI commands.
Index ¶
- func RunInitForm(extends, name, path, version, schemaOrg, format *string, createSpec *bool) error
- func RunPortConnectionsForm(existingConns map[string]opendpi.Connection) ([]opendpi.PortConnection, map[string]opendpi.Connection, error)
- func RunSchemaForm(name *string, schema *jsonschema.Schema, schemas map[string]*jsonschema.Schema) error
- func RunTranslateFormatSelect(value *string, formats []string) *huh.Select[string]
- type ConnectionAddResult
- type PortAddResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunInitForm ¶
RunInitForm runs the interactive form for the init command. It fills the provided pointers with user input.
func RunPortConnectionsForm ¶
func RunPortConnectionsForm(existingConns map[string]opendpi.Connection) ([]opendpi.PortConnection, map[string]opendpi.Connection, error)
RunPortConnectionsForm handles adding connections to a port, allowing both creating new connections and using existing ones.
func RunSchemaForm ¶
func RunSchemaForm(name *string, schema *jsonschema.Schema, schemas map[string]*jsonschema.Schema) error
RunSchemaForm prompts the user to define or select a schema. If name is nil, the schema name prompt is skipped (used for nested schemas like properties/items).
Types ¶
type ConnectionAddResult ¶
type ConnectionAddResult struct {
Name string
Connection opendpi.Connection
}
ConnectionAddResult holds the result of connection form functions.
func RunAddNewConnectionForm ¶
func RunAddNewConnectionForm(existingConns map[string]opendpi.Connection) (ConnectionAddResult, error)
RunAddNewConnectionForm runs the interactive form for creating a new connection.
func RunSelectConnectionForm ¶
func RunSelectConnectionForm(existingConns map[string]opendpi.Connection) (ConnectionAddResult, error)
RunSelectConnectionForm prompts for selecting one existing connection.
type PortAddResult ¶
type PortAddResult struct {
Name string
Description string
Schema *jsonschema.Schema
SchemaPath string
Connections []opendpi.PortConnection
NewConns map[string]opendpi.Connection
}
PortAddResult holds the result of RunAddPortForm.
func RunAddPortForm ¶
func RunAddPortForm( existingPorts map[string]opendpi.Port, existingConns map[string]opendpi.Connection, existingSchemas map[string]*jsonschema.Schema, ) (result PortAddResult, _ error)
RunAddPortForm runs the interactive form for adding a port. Returns PortAddResult containing port name, description, schema, schemaPath (if file selected), connections, and newConns (connections created during this form that need to be added to spec).