action_result_schema

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package action_result_schema provides an example of creating an action with structured output using result schema. It demonstrates how to define a result schema in action.yaml and return structured data that can be output as JSON with --json flag.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	ID        int    `json:"id"`
	Name      string `json:"name"`
	CreatedAt string `json:"created_at"`
}

Item represents a generated item.

type Plugin

type Plugin struct{}

Plugin is launchr.Plugin providing example plugin action with result schema.

func (*Plugin) DiscoverActions

func (p *Plugin) DiscoverActions(_ context.Context) ([]*action.Action, error)

DiscoverActions implements launchr.ActionDiscoveryPlugin interface.

func (*Plugin) PluginInfo

func (p *Plugin) PluginInfo() launchr.PluginInfo

PluginInfo implements launchr.Plugin interface.

type Result

type Result struct {
	Items   []Item  `json:"items"`
	Summary Summary `json:"summary"`
}

Result is the structured output of the action.

type Summary

type Summary struct {
	Total  int    `json:"total"`
	Prefix string `json:"prefix"`
}

Summary contains summary statistics.

Jump to

Keyboard shortcuts

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