Documentation
¶
Index ¶
Constants ¶
View Source
const Name = "input"
Name of the service as used by workflows.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Field ¶
type Field struct {
// Label displayed to the user (required).
Label string `json:"label,omitempty"`
// Name used as the key in the resulting map (defaults to Label if empty).
Name string `json:"name,omitempty"`
// Options – if provided – make this a single-choice (radio) field. A user
// can answer with either a number (1-N) corresponding to the option index
// or by typing the option value verbatim (case-insensitive).
Options []string `json:"options,omitempty"`
// Default value returned when the user enters empty line.
Default string `json:"default,omitempty"`
}
Field describes a single input element in a form.
type FormOutput ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements types.Service and allows workflows to collect data from a user via standard input/output. Two methods are exposed:
ask – free-form text prompt (single field) form – multi-field prompt with optional predefined choices (radio-style)
Tests can substitute Reader/Writer to avoid interactive TTY requirements.
func (*Service) Methods ¶
func (s *Service) Methods() types.Signatures
Click to show internal directories.
Click to hide internal directories.