elicitations

package
v0.0.0-...-66c9f5b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSurveyClient

func NewSurveyClient(stdin term.FileReader, stdout term.FileWriter, stderr io.Writer) *surveyClient

func WithDefault

func WithDefault(value string) func(*Options)

func WithValidator

func WithValidator(validator func(any) error) func(*Options)

Types

type Client

type Client interface {
	Request(ctx context.Context, req Request) (Response, error)
}

type Controller

type Controller interface {
	RequestString(ctx context.Context, message, field string, opts ...func(*Options)) (string, error)
	RequestEnum(ctx context.Context, message, field string, options []string) (string, error)
	SetSupported(supported bool)
	IsSupported() bool
}

func NewController

func NewController(client Client) Controller

type Options

type Options struct {
	DefaultValue string
	Validator    func(any) error
}

type Request

type Request struct {
	Message   string
	Schema    map[string]any
	Validator Validator
}

type Response

type Response struct {
	Action  string
	Content map[string]any
}

type Validator

type Validator func(any) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL