executor

package
v0.0.78 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package executor provides semantic action execution with registry-based service discovery. This is the core executor for all EVE-based semantic actions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportAsJSONLD

func ExportAsJSONLD(action *semantic.SemanticScheduledAction) ([]byte, error)

ExportAsJSONLD exports an action as JSON-LD

func IntrospectAction

func IntrospectAction(action *semantic.SemanticScheduledAction) map[string]interface{}

IntrospectAction analyzes what an action will do (semantic introspection)

func QueryActionsByType

func QueryActionsByType(actions []*semantic.SemanticScheduledAction, actionType string) []*semantic.SemanticScheduledAction

QueryActionsByType returns all actions of a specific semantic type

func QueryActionsByURL

func QueryActionsByURL(actions []*semantic.SemanticScheduledAction, urlPattern string) []*semantic.SemanticScheduledAction

QueryActionsByURL returns all actions that interact with a specific URL

func ResolveRegistryURL

func ResolveRegistryURL(registryURL string) (string, error)

ResolveRegistryURL resolves registry://servicename/path to http://host:port/path Example: registry://infisicalservice/v1/api/semantic/action -> http://localhost:8093/v1/api/semantic/action Cache can be disabled for development via REGISTRY_CACHE_ENABLED=false

Types

type CommandExecutor

type CommandExecutor struct{}

CommandExecutor executes actions with command property (backward compatibility)

func (*CommandExecutor) CanHandle

func (e *CommandExecutor) CanHandle(action *semantic.SemanticScheduledAction) bool

func (*CommandExecutor) Execute

type Executor

type Executor interface {
	// Execute runs a semantic action and returns output, error
	Execute(action *semantic.SemanticScheduledAction) (string, error)

	// CanHandle returns true if this executor can handle the given action
	CanHandle(action *semantic.SemanticScheduledAction) bool
}

Executor defines the interface for semantic action executors

type Registry

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

Registry manages semantic executors with priority-based dispatch

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new executor registry with default executors

func (*Registry) Execute

func (r *Registry) Execute(action *semantic.SemanticScheduledAction) (string, error)

Execute finds appropriate executor and runs the action

func (*Registry) Register

func (r *Registry) Register(executor Executor)

Register adds a new executor to the registry (prepended for priority)

type ScheduledActionExecutor

type ScheduledActionExecutor struct {
	FetcherPath string
	Registry    *Registry // Reference to registry for delegating embedded actions
}

ScheduledActionExecutor handles ScheduledAction wrapper type and HTTP-property actions This executor is for backward compatibility with non-semantic action definitions.

func (*ScheduledActionExecutor) CanHandle

func (*ScheduledActionExecutor) Execute

type Service

type Service struct {
	Identifier string                 `json:"identifier"`
	Name       string                 `json:"name"`
	URL        string                 `json:"url"`
	Properties map[string]interface{} `json:"additionalProperty"`
}

Service represents a registered service from the registry API

func FindServicesByCapability added in v0.0.30

func FindServicesByCapability(capability string) ([]*Service, error)

FindServicesByCapability queries the registry for services with a specific capability

type URLBasedExecutor

type URLBasedExecutor struct{}

URLBasedExecutor routes actions to any service with /v1/api/semantic/action endpoint This is the universal executor for all semantic service endpoints.

func (*URLBasedExecutor) CanHandle

func (e *URLBasedExecutor) CanHandle(action *semantic.SemanticScheduledAction) bool

func (*URLBasedExecutor) Execute

Jump to

Keyboard shortcuts

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