action

package
v0.19.4 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OPTIONS_PREFIX            = "options-"
	OPTIONS_PREFIX_UNDERSCORE = "options_"
)
View Source
const API_PATH = "/api"

API_PATH is the path under the app path which is reserved for the actions REST API. Action apps cannot define an action at this path

Variables

This section is empty.

Functions

func BuildAPIRouter added in v0.19.4

func BuildAPIRouter(appName, appPath string, actions []*Action) *chi.Mux

BuildAPIRouter creates the router for the actions REST API. Each action gets exec/suggest/validate endpoints under the per operation prefixes, in addition to the app level action list and OpenAPI spec endpoints

func RunDeferredCleanup

func RunDeferredCleanup(thread *starlark.Thread) error

Types

type Action

type Action struct {
	*types.Logger

	AppTemplate *template.Template
	StyleType   types.StyleType
	LightTheme  string
	DarkTheme   string

	Links []ActionLink // links to other actions
	// contains filtered or unexported fields
}

Action represents a single action that is exposed by the App. Actions provide a way to trigger app operations, with an auto-generated form UI and an API interface

func NewAction

func NewAction(logger *types.Logger, sourceFS *appfs.SourceFs, isDev bool, name, description, appName, apath string, run, suggest starlark.Callable,
	params []apptype.AppParam, paramValuesStr map[string]string, paramDict starlark.StringDict,
	appPath string, styleType types.StyleType, containerProxyUrl string, hidden []string, showValidate bool,
	auditInsert func(*types.AuditEvent) error, containerManager any, jsLibs []types.JSLibrary, appPathDomain types.AppPathDomain,
	serverConfig *types.ServerConfig, actionConfig types.ActionConfig, permit []string, rbacApi rbac.RBACAPI) (*Action, error)

NewAction creates a new action

func (*Action) BuildRouter

func (a *Action) BuildRouter() (*chi.Mux, error)
func (a *Action) GetLink() ActionLink
type ActionLink struct {
	Name       string
	Path       string
	Permits    []string
	Authorized bool
	Active     bool // whether this link is the currently shown action
}

type Args

type Args struct {
	// contains filtered or unexported fields
}

Args is a starlark.Value that represents the arguments being passed to the Action handler. It contains value for the params.

func NewArgs added in v0.19.4

func NewArgs(members starlark.StringDict) *Args

NewArgs builds an Args value from the given members

func (*Args) Attr

func (a *Args) Attr(name string) (starlark.Value, error)

func (*Args) AttrNames

func (a *Args) AttrNames() []string

func (*Args) Freeze

func (a *Args) Freeze()

func (*Args) Hash

func (a *Args) Hash() (uint32, error)

func (*Args) String

func (a *Args) String() string

func (*Args) Truth

func (a *Args) Truth() starlark.Bool

func (*Args) Type

func (a *Args) Type() string

type ParamDef

type ParamDef struct {
	Name               string
	Description        string
	Value              any
	InputType          string
	Options            []string
	Strict             bool // dropdown value must be one of the options (default; COMBO display type loosens)
	DisplayType        string
	DisplayTypeOptions string
}

Jump to

Keyboard shortcuts

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