cmds

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HelpersParameterLayer added in v0.1.4

func HelpersParameterLayer() (layers.ParameterLayer, error)

Types

type GeppettoCommand

type GeppettoCommand struct {
	Factories map[string]interface{} `yaml:"__factories,omitempty"`
	Prompt    string
	// contains filtered or unexported fields
}

func NewGeppettoCommand added in v0.1.4

func NewGeppettoCommand(
	description *glazedcmds.CommandDescription,
	factories map[string]interface{},
	prompt string,
) (*GeppettoCommand, error)

func (*GeppettoCommand) Description

func (g *GeppettoCommand) Description() *glazedcmds.CommandDescription

func (*GeppettoCommand) Run

func (g *GeppettoCommand) Run(
	ctx context.Context,
	parsedLayers map[string]*layers.ParsedParameterLayer,
	ps map[string]interface{},
	gp processor.TableProcessor,
) error

type GeppettoCommandDescription

type GeppettoCommandDescription struct {
	Name      string                            `yaml:"name"`
	Short     string                            `yaml:"short"`
	Long      string                            `yaml:"long,omitempty"`
	Flags     []*parameters.ParameterDefinition `yaml:"flags,omitempty"`
	Arguments []*parameters.ParameterDefinition `yaml:"arguments,omitempty"`
	Layers    []layers.ParameterLayer           `yaml:"layers,omitempty"`

	// TODO(manuel, 2023-02-04) This now has a hack to switch the step type
	Step *steps.StepDescription `yaml:"step,omitempty"`

	Prompt   string         `yaml:"prompt,omitempty"`
	Messages []chat.Message `yaml:"messages,omitempty"`
}

type GeppettoCommandLoader

type GeppettoCommandLoader struct {
}

func (*GeppettoCommandLoader) LoadCommandAliasFromYAML

func (g *GeppettoCommandLoader) LoadCommandAliasFromYAML(s io.Reader, options ...alias.Option) ([]*alias.CommandAlias, error)

func (*GeppettoCommandLoader) LoadCommandFromYAML

func (g *GeppettoCommandLoader) LoadCommandFromYAML(
	s io.Reader,
	options ...glazedcmds.CommandDescriptionOption,
) ([]glazedcmds.Command, error)

Jump to

Keyboard shortcuts

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