Help us shape the future of Go! Take the 2026 Go Developer Survey

action

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	Name() string

	// RunJSON uses encoding/json to unmarshal the input,
	// calls Action.Run, then returns the marshaled result.
	RunJSON(ctx context.Context, input json.RawMessage, cb func(context.Context, json.RawMessage) error) (json.RawMessage, error)

	// Desc returns a description of the action.
	// It should set all fields of actionDesc except Key, which
	// the registry will set.
	Desc() Desc
}

Action is the type that all Action[I, O, S] have in common. Internal version.

type Desc

type Desc struct {
	Key          string             `json:"key"` // full key from the registry
	Name         string             `json:"name"`
	Description  string             `json:"description"`
	Metadata     map[string]any     `json:"metadata"`
	InputSchema  *jsonschema.Schema `json:"inputSchema"`
	OutputSchema *jsonschema.Schema `json:"outputSchema"`
}

A Desc is a description of an Action. It is used to provide a list of registered actions.

Jump to

Keyboard shortcuts

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