space_exec

package
v0.51.3 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: Apache-2.0 Imports: 51 Imported by: 0

Documentation

Index

Constants

View Source
const ExportZipConfigID = "space-exec/export-zip"

ExportZipConfigID is the config ID for the export-zip handler.

View Source
const FileHashConfigID = "space-exec/file-hash"

FileHashConfigID is the config ID for the file-hash handler.

View Source
const NoopConfigID = "space-exec/noop"

NoopConfigID is the config ID for the noop handler.

View Source
const PluginExecConfigID = "space-exec/plugin"

PluginExecConfigID is the config ID for the plugin bridge handler.

View Source
const SRPCPluginExecServiceServiceID = "space.exec.PluginExecService"
View Source
const UnixfsReadConfigID = "space-exec/unixfs-read"

UnixfsReadConfigID is the config ID for the unixfs-read handler.

Variables

View Source
var ErrUnknownConfigID = errors.New("unknown exec handler config ID")

ErrUnknownConfigID is returned when the config ID has no registered handler.

View Source
var GitCloneConfigID = forge_lib_git_clone.ConfigID

GitCloneConfigID is the config ID for the space-aware git clone handler. Matches the existing forge/lib/git/clone ConfigID so existing task targets work.

View Source
var KvtxConfigID = forge_lib_kvtx.ConfigID

KvtxConfigID is the config ID for the space-aware kvtx handler. Matches the existing forge/lib/kvtx ConfigID so existing task targets work.

Functions

func BridgeFactories

func BridgeFactories(r *Registry) []controller.Factory

BridgeFactories returns bus-compatible controller factories for all handlers in the registry. Each handler gets a BridgeFactory that responds to LoadConfigConstructorByID and LoadFactoryByConfig on the bus, making all space-exec handlers discoverable through the standard forge execution controller dispatch. Other plugins can contribute additional handlers by registering their own controller factories on the bus.

func NewNoopTarget

func NewNoopTarget() *forge_target.Target

NewNoopTarget returns a Forge target that runs through the noop bridge.

func NewSRPCPluginExecServiceHandler added in v0.51.0

func NewSRPCPluginExecServiceHandler(impl SRPCPluginExecServiceServer, serviceID string) srpc.Handler

NewSRPCPluginExecServiceHandler constructs a new RPC handler. serviceID: if empty, uses default: space.exec.PluginExecService

func ProcessExecution

func ProcessExecution(
	ctx context.Context,
	le *logrus.Entry,
	ws world.WorldState,
	registry *Registry,
	objectKey string,
	peerID peer.ID,
) error

ProcessExecution reads an execution object from world state and runs the target exec handler through the SpaceExecRegistry. Manages the full lifecycle: PENDING -> RUNNING -> COMPLETE/FAILED.

Returns nil when the execution completes (success or failure recorded). Returns an error if the execution cannot be processed (object missing, etc.).

func RegisterExportZip

func RegisterExportZip(r *Registry)

RegisterExportZip registers the export-zip handler in the registry.

func RegisterFileHash

func RegisterFileHash(r *Registry)

RegisterFileHash registers the file-hash handler in the registry.

func RegisterGitClone

func RegisterGitClone(r *Registry)

RegisterGitClone registers the git clone handler in the registry.

func RegisterKvtx

func RegisterKvtx(r *Registry)

RegisterKvtx registers the kvtx handler in the registry.

func RegisterNoop

func RegisterNoop(r *Registry)

RegisterNoop registers the noop handler in the registry.

func RegisterPluginExec added in v0.51.0

func RegisterPluginExec(r *Registry, b bus.Bus)

RegisterPluginExec registers the plugin bridge handler in the registry.

func RegisterUnixfsRead

func RegisterUnixfsRead(r *Registry)

RegisterUnixfsRead registers the unixfs-read handler in the registry.

func SRPCRegisterPluginExecService added in v0.51.0

func SRPCRegisterPluginExecService(mux srpc.Mux, impl SRPCPluginExecServiceServer) error

SRPCRegisterPluginExecService registers the implementation with the mux. Uses the default serviceID: space.exec.PluginExecService

Types

type BridgeFactory

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

BridgeFactory creates a bus-compatible controller factory from a SpaceExecRegistry handler. This adapts space-aware handlers (no bus.Bus access) to work within the existing forge execution controller dispatch.

The forge execution controller resolves config IDs through the bus:

  • LoadConfigConstructorByID finds this factory (via static resolver)
  • ConstructConfig returns a SpaceExecConfig that stores raw config bytes
  • LoadFactoryByConfig finds this factory again
  • Construct creates a bridgeController delegating to the SpaceExecRegistry

This makes all space-exec handlers discoverable through the standard bus mechanism, so other plugins can also register handlers by adding their own controller factories.

func NewBridgeFactory

func NewBridgeFactory(configID string, registry *Registry) *BridgeFactory

NewBridgeFactory creates a bridge factory for the given config ID.

func (*BridgeFactory) Construct

Construct creates a bridge controller that delegates to SpaceExecRegistry.

func (*BridgeFactory) ConstructConfig

func (f *BridgeFactory) ConstructConfig() config.Config

ConstructConfig returns a SpaceExecConfig that stores raw config bytes. The forge execution controller's Resolve path calls this, then unmarshals the target's config data into the returned object.

func (*BridgeFactory) GetConfigID

func (f *BridgeFactory) GetConfigID() string

GetConfigID returns the config ID this factory handles.

func (*BridgeFactory) GetVersion

func (f *BridgeFactory) GetVersion() semver.Version

GetVersion returns the bridge factory version.

type Handler

type Handler interface {
	// Execute runs the handler to completion.
	Execute(ctx context.Context) error
}

Handler executes a single forge task within the space context. Receives inputs, performs work via the handle, sets outputs, returns. Returning nil signals successful completion. Returning an error signals failure.

func NewExportZipHandler

func NewExportZipHandler(
	ctx context.Context,
	le *logrus.Entry,
	ws world.WorldState,
	handle forge_target.ExecControllerHandle,
	inputs forge_target.InputMap,
	configData []byte,
) (Handler, error)

NewExportZipHandler constructs an export-zip space handler.

func NewFileHashHandler

func NewFileHashHandler(
	ctx context.Context,
	le *logrus.Entry,
	ws world.WorldState,
	handle forge_target.ExecControllerHandle,
	inputs forge_target.InputMap,
	configData []byte,
) (Handler, error)

NewFileHashHandler constructs a file-hash space handler.

func NewGitCloneHandler

func NewGitCloneHandler(
	ctx context.Context,
	le *logrus.Entry,
	ws world.WorldState,
	handle forge_target.ExecControllerHandle,
	inputs forge_target.InputMap,
	configData []byte,
) (Handler, error)

NewGitCloneHandler constructs a git clone space handler. Deserializes configData as the forge/lib/git/clone Config proto and executes the clone using world state directly (no bus access).

func NewKvtxHandler

func NewKvtxHandler(
	ctx context.Context,
	le *logrus.Entry,
	ws world.WorldState,
	handle forge_target.ExecControllerHandle,
	inputs forge_target.InputMap,
	configData []byte,
) (Handler, error)

NewKvtxHandler constructs a kvtx space handler. Deserializes configData as the kvtx Config proto, constructs the controller with a nil bus (unused by kvtx), and initializes it with inputs and handle.

func NewNoopHandler

func NewNoopHandler(
	ctx context.Context,
	le *logrus.Entry,
	ws world.WorldState,
	handle forge_target.ExecControllerHandle,
	inputs forge_target.InputMap,
	configData []byte,
) (Handler, error)

NewNoopHandler constructs a noop handler.

func NewUnixfsReadHandler

func NewUnixfsReadHandler(
	ctx context.Context,
	le *logrus.Entry,
	ws world.WorldState,
	handle forge_target.ExecControllerHandle,
	inputs forge_target.InputMap,
	configData []byte,
) (Handler, error)

NewUnixfsReadHandler constructs a unixfs-read space handler.

type HandlerFactory

type HandlerFactory func(
	ctx context.Context,
	le *logrus.Entry,
	ws world.WorldState,
	handle forge_target.ExecControllerHandle,
	inputs forge_target.InputMap,
	configData []byte,
) (Handler, error)

HandlerFactory constructs a Handler for a given exec config ID. No bus.Bus parameter: handlers access only the world state and exec handle.

func NewPluginExecHandler added in v0.51.0

func NewPluginExecHandler(b bus.Bus) HandlerFactory

NewPluginExecHandler constructs a plugin bridge handler factory.

type PluginExecConfig added in v0.51.0

type PluginExecConfig struct {

	// PluginId is the plugin to load before executing.
	PluginId string `protobuf:"bytes,1,opt,name=plugin_id,json=pluginId,proto3" json:"pluginId,omitempty"`
	// ControllerId is the plugin-owned execution controller id to invoke.
	ControllerId string `protobuf:"bytes,2,opt,name=controller_id,json=controllerId,proto3" json:"controllerId,omitempty"`
	// ControllerConfig is opaque config bytes for the plugin-owned controller.
	ControllerConfig []byte `protobuf:"bytes,3,opt,name=controller_config,json=controllerConfig,proto3" json:"controllerConfig,omitempty"`
	// contains filtered or unexported fields
}

PluginExecConfig configures the generic plugin execution bridge.

func (*PluginExecConfig) CloneMessageVT added in v0.51.0

func (m *PluginExecConfig) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*PluginExecConfig) CloneVT added in v0.51.0

func (m *PluginExecConfig) CloneVT() *PluginExecConfig

func (*PluginExecConfig) EqualMessageVT added in v0.51.0

func (this *PluginExecConfig) EqualMessageVT(thatMsg any) bool

func (*PluginExecConfig) EqualVT added in v0.51.0

func (this *PluginExecConfig) EqualVT(that *PluginExecConfig) bool

func (*PluginExecConfig) EqualsConfig added in v0.51.0

func (c *PluginExecConfig) EqualsConfig(other config.Config) bool

EqualsConfig checks equality with another plugin bridge config.

func (*PluginExecConfig) GetConfigID added in v0.51.0

func (c *PluginExecConfig) GetConfigID() string

GetConfigID returns the config ID.

func (*PluginExecConfig) GetControllerConfig added in v0.51.0

func (x *PluginExecConfig) GetControllerConfig() []byte

func (*PluginExecConfig) GetControllerId added in v0.51.0

func (x *PluginExecConfig) GetControllerId() string

func (*PluginExecConfig) GetPluginId added in v0.51.0

func (x *PluginExecConfig) GetPluginId() string

func (*PluginExecConfig) MarshalBlock added in v0.51.0

func (c *PluginExecConfig) MarshalBlock() ([]byte, error)

MarshalBlock marshals the config as protobuf bytes.

func (*PluginExecConfig) MarshalJSON added in v0.51.0

func (x *PluginExecConfig) MarshalJSON() ([]byte, error)

MarshalJSON marshals the PluginExecConfig to JSON.

func (*PluginExecConfig) MarshalProtoJSON added in v0.51.0

func (x *PluginExecConfig) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the PluginExecConfig message to JSON.

func (*PluginExecConfig) MarshalProtoText added in v0.51.0

func (x *PluginExecConfig) MarshalProtoText() string

func (*PluginExecConfig) MarshalToSizedBufferVT added in v0.51.0

func (m *PluginExecConfig) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*PluginExecConfig) MarshalToVT added in v0.51.0

func (m *PluginExecConfig) MarshalToVT(dAtA []byte) (int, error)

func (*PluginExecConfig) MarshalVT added in v0.51.0

func (m *PluginExecConfig) MarshalVT() (dAtA []byte, err error)

func (*PluginExecConfig) ProtoMessage added in v0.51.0

func (*PluginExecConfig) ProtoMessage()

func (*PluginExecConfig) Reset added in v0.51.0

func (x *PluginExecConfig) Reset()

func (*PluginExecConfig) SizeVT added in v0.51.0

func (m *PluginExecConfig) SizeVT() (n int)

func (*PluginExecConfig) String added in v0.51.0

func (x *PluginExecConfig) String() string

func (*PluginExecConfig) UnmarshalBlock added in v0.51.0

func (c *PluginExecConfig) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the config from protobuf bytes.

func (*PluginExecConfig) UnmarshalJSON added in v0.51.0

func (x *PluginExecConfig) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the PluginExecConfig from JSON.

func (*PluginExecConfig) UnmarshalProtoJSON added in v0.51.0

func (x *PluginExecConfig) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the PluginExecConfig message from JSON.

func (*PluginExecConfig) UnmarshalVT added in v0.51.0

func (m *PluginExecConfig) UnmarshalVT(dAtA []byte) error

func (*PluginExecConfig) Validate added in v0.51.0

func (c *PluginExecConfig) Validate() error

Validate checks that the plugin bridge has enough routing information.

type PluginExecLog added in v0.51.0

type PluginExecLog struct {

	// Level is the log severity.
	Level string `protobuf:"bytes,1,opt,name=level,proto3" json:"level,omitempty"`
	// Message is the log message.
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

PluginExecLog is a log entry emitted by a plugin execution controller.

func (*PluginExecLog) CloneMessageVT added in v0.51.0

func (m *PluginExecLog) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*PluginExecLog) CloneVT added in v0.51.0

func (m *PluginExecLog) CloneVT() *PluginExecLog

func (*PluginExecLog) EqualMessageVT added in v0.51.0

func (this *PluginExecLog) EqualMessageVT(thatMsg any) bool

func (*PluginExecLog) EqualVT added in v0.51.0

func (this *PluginExecLog) EqualVT(that *PluginExecLog) bool

func (*PluginExecLog) GetLevel added in v0.51.0

func (x *PluginExecLog) GetLevel() string

func (*PluginExecLog) GetMessage added in v0.51.0

func (x *PluginExecLog) GetMessage() string

func (*PluginExecLog) MarshalJSON added in v0.51.0

func (x *PluginExecLog) MarshalJSON() ([]byte, error)

MarshalJSON marshals the PluginExecLog to JSON.

func (*PluginExecLog) MarshalProtoJSON added in v0.51.0

func (x *PluginExecLog) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the PluginExecLog message to JSON.

func (*PluginExecLog) MarshalProtoText added in v0.51.0

func (x *PluginExecLog) MarshalProtoText() string

func (*PluginExecLog) MarshalToSizedBufferVT added in v0.51.0

func (m *PluginExecLog) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*PluginExecLog) MarshalToVT added in v0.51.0

func (m *PluginExecLog) MarshalToVT(dAtA []byte) (int, error)

func (*PluginExecLog) MarshalVT added in v0.51.0

func (m *PluginExecLog) MarshalVT() (dAtA []byte, err error)

func (*PluginExecLog) ProtoMessage added in v0.51.0

func (*PluginExecLog) ProtoMessage()

func (*PluginExecLog) Reset added in v0.51.0

func (x *PluginExecLog) Reset()

func (*PluginExecLog) SizeVT added in v0.51.0

func (m *PluginExecLog) SizeVT() (n int)

func (*PluginExecLog) String added in v0.51.0

func (x *PluginExecLog) String() string

func (*PluginExecLog) UnmarshalJSON added in v0.51.0

func (x *PluginExecLog) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the PluginExecLog from JSON.

func (*PluginExecLog) UnmarshalProtoJSON added in v0.51.0

func (x *PluginExecLog) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the PluginExecLog message from JSON.

func (*PluginExecLog) UnmarshalVT added in v0.51.0

func (m *PluginExecLog) UnmarshalVT(dAtA []byte) error

type PluginExecOutputFile added in v0.51.0

type PluginExecOutputFile struct {

	// Path is the slash-separated path relative to the output root.
	Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	// Data is the file contents.
	Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

PluginExecOutputFile is one captured output file from a plugin controller.

func (*PluginExecOutputFile) CloneMessageVT added in v0.51.0

func (*PluginExecOutputFile) CloneVT added in v0.51.0

func (*PluginExecOutputFile) EqualMessageVT added in v0.51.0

func (this *PluginExecOutputFile) EqualMessageVT(thatMsg any) bool

func (*PluginExecOutputFile) EqualVT added in v0.51.0

func (this *PluginExecOutputFile) EqualVT(that *PluginExecOutputFile) bool

func (*PluginExecOutputFile) GetData added in v0.51.0

func (x *PluginExecOutputFile) GetData() []byte

func (*PluginExecOutputFile) GetPath added in v0.51.0

func (x *PluginExecOutputFile) GetPath() string

func (*PluginExecOutputFile) MarshalJSON added in v0.51.0

func (x *PluginExecOutputFile) MarshalJSON() ([]byte, error)

MarshalJSON marshals the PluginExecOutputFile to JSON.

func (*PluginExecOutputFile) MarshalProtoJSON added in v0.51.0

func (x *PluginExecOutputFile) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the PluginExecOutputFile message to JSON.

func (*PluginExecOutputFile) MarshalProtoText added in v0.51.0

func (x *PluginExecOutputFile) MarshalProtoText() string

func (*PluginExecOutputFile) MarshalToSizedBufferVT added in v0.51.0

func (m *PluginExecOutputFile) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*PluginExecOutputFile) MarshalToVT added in v0.51.0

func (m *PluginExecOutputFile) MarshalToVT(dAtA []byte) (int, error)

func (*PluginExecOutputFile) MarshalVT added in v0.51.0

func (m *PluginExecOutputFile) MarshalVT() (dAtA []byte, err error)

func (*PluginExecOutputFile) ProtoMessage added in v0.51.0

func (*PluginExecOutputFile) ProtoMessage()

func (*PluginExecOutputFile) Reset added in v0.51.0

func (x *PluginExecOutputFile) Reset()

func (*PluginExecOutputFile) SizeVT added in v0.51.0

func (m *PluginExecOutputFile) SizeVT() (n int)

func (*PluginExecOutputFile) String added in v0.51.0

func (x *PluginExecOutputFile) String() string

func (*PluginExecOutputFile) UnmarshalJSON added in v0.51.0

func (x *PluginExecOutputFile) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the PluginExecOutputFile from JSON.

func (*PluginExecOutputFile) UnmarshalProtoJSON added in v0.51.0

func (x *PluginExecOutputFile) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the PluginExecOutputFile message from JSON.

func (*PluginExecOutputFile) UnmarshalVT added in v0.51.0

func (m *PluginExecOutputFile) UnmarshalVT(dAtA []byte) error

type PluginExecRequest added in v0.51.0

type PluginExecRequest struct {

	// ControllerId is the plugin-owned execution controller id to invoke.
	ControllerId string `protobuf:"bytes,1,opt,name=controller_id,json=controllerId,proto3" json:"controllerId,omitempty"`
	// ControllerConfig is opaque config bytes for the plugin-owned controller.
	ControllerConfig []byte `protobuf:"bytes,2,opt,name=controller_config,json=controllerConfig,proto3" json:"controllerConfig,omitempty"`
	// Inputs are the Forge execution inputs.
	Inputs []*value.Value `protobuf:"bytes,3,rep,name=inputs,proto3" json:"inputs,omitempty"`
	// contains filtered or unexported fields
}

PluginExecRequest asks a loaded plugin to execute a controller.

func (*PluginExecRequest) CloneMessageVT added in v0.51.0

func (m *PluginExecRequest) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*PluginExecRequest) CloneVT added in v0.51.0

func (m *PluginExecRequest) CloneVT() *PluginExecRequest

func (*PluginExecRequest) EqualMessageVT added in v0.51.0

func (this *PluginExecRequest) EqualMessageVT(thatMsg any) bool

func (*PluginExecRequest) EqualVT added in v0.51.0

func (this *PluginExecRequest) EqualVT(that *PluginExecRequest) bool

func (*PluginExecRequest) GetControllerConfig added in v0.51.0

func (x *PluginExecRequest) GetControllerConfig() []byte

func (*PluginExecRequest) GetControllerId added in v0.51.0

func (x *PluginExecRequest) GetControllerId() string

func (*PluginExecRequest) GetInputs added in v0.51.0

func (x *PluginExecRequest) GetInputs() []*value.Value

func (*PluginExecRequest) MarshalJSON added in v0.51.0

func (x *PluginExecRequest) MarshalJSON() ([]byte, error)

MarshalJSON marshals the PluginExecRequest to JSON.

func (*PluginExecRequest) MarshalProtoJSON added in v0.51.0

func (x *PluginExecRequest) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the PluginExecRequest message to JSON.

func (*PluginExecRequest) MarshalProtoText added in v0.51.0

func (x *PluginExecRequest) MarshalProtoText() string

func (*PluginExecRequest) MarshalToSizedBufferVT added in v0.51.0

func (m *PluginExecRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*PluginExecRequest) MarshalToVT added in v0.51.0

func (m *PluginExecRequest) MarshalToVT(dAtA []byte) (int, error)

func (*PluginExecRequest) MarshalVT added in v0.51.0

func (m *PluginExecRequest) MarshalVT() (dAtA []byte, err error)

func (*PluginExecRequest) ProtoMessage added in v0.51.0

func (*PluginExecRequest) ProtoMessage()

func (*PluginExecRequest) Reset added in v0.51.0

func (x *PluginExecRequest) Reset()

func (*PluginExecRequest) SizeVT added in v0.51.0

func (m *PluginExecRequest) SizeVT() (n int)

func (*PluginExecRequest) String added in v0.51.0

func (x *PluginExecRequest) String() string

func (*PluginExecRequest) UnmarshalJSON added in v0.51.0

func (x *PluginExecRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the PluginExecRequest from JSON.

func (*PluginExecRequest) UnmarshalProtoJSON added in v0.51.0

func (x *PluginExecRequest) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the PluginExecRequest message from JSON.

func (*PluginExecRequest) UnmarshalVT added in v0.51.0

func (m *PluginExecRequest) UnmarshalVT(dAtA []byte) error

type PluginExecResponse added in v0.51.0

type PluginExecResponse struct {

	// Logs are execution logs to append to the Forge execution.
	Logs []*PluginExecLog `protobuf:"bytes,1,rep,name=logs,proto3" json:"logs,omitempty"`
	// Outputs are Forge execution outputs to set.
	Outputs []*value.Value `protobuf:"bytes,2,rep,name=outputs,proto3" json:"outputs,omitempty"`
	// Error is the plugin execution failure message, if any.
	Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"`
	// OutputFiles are files to import as the default UnixFS "output" value.
	OutputFiles []*PluginExecOutputFile `protobuf:"bytes,4,rep,name=output_files,json=outputFiles,proto3" json:"outputFiles,omitempty"`
	// contains filtered or unexported fields
}

PluginExecResponse contains controller logs, outputs, and optional failure.

func (*PluginExecResponse) CloneMessageVT added in v0.51.0

func (m *PluginExecResponse) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*PluginExecResponse) CloneVT added in v0.51.0

func (m *PluginExecResponse) CloneVT() *PluginExecResponse

func (*PluginExecResponse) EqualMessageVT added in v0.51.0

func (this *PluginExecResponse) EqualMessageVT(thatMsg any) bool

func (*PluginExecResponse) EqualVT added in v0.51.0

func (this *PluginExecResponse) EqualVT(that *PluginExecResponse) bool

func (*PluginExecResponse) GetError added in v0.51.0

func (x *PluginExecResponse) GetError() string

func (*PluginExecResponse) GetLogs added in v0.51.0

func (x *PluginExecResponse) GetLogs() []*PluginExecLog

func (*PluginExecResponse) GetOutputFiles added in v0.51.0

func (x *PluginExecResponse) GetOutputFiles() []*PluginExecOutputFile

func (*PluginExecResponse) GetOutputs added in v0.51.0

func (x *PluginExecResponse) GetOutputs() []*value.Value

func (*PluginExecResponse) MarshalJSON added in v0.51.0

func (x *PluginExecResponse) MarshalJSON() ([]byte, error)

MarshalJSON marshals the PluginExecResponse to JSON.

func (*PluginExecResponse) MarshalProtoJSON added in v0.51.0

func (x *PluginExecResponse) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the PluginExecResponse message to JSON.

func (*PluginExecResponse) MarshalProtoText added in v0.51.0

func (x *PluginExecResponse) MarshalProtoText() string

func (*PluginExecResponse) MarshalToSizedBufferVT added in v0.51.0

func (m *PluginExecResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*PluginExecResponse) MarshalToVT added in v0.51.0

func (m *PluginExecResponse) MarshalToVT(dAtA []byte) (int, error)

func (*PluginExecResponse) MarshalVT added in v0.51.0

func (m *PluginExecResponse) MarshalVT() (dAtA []byte, err error)

func (*PluginExecResponse) ProtoMessage added in v0.51.0

func (*PluginExecResponse) ProtoMessage()

func (*PluginExecResponse) Reset added in v0.51.0

func (x *PluginExecResponse) Reset()

func (*PluginExecResponse) SizeVT added in v0.51.0

func (m *PluginExecResponse) SizeVT() (n int)

func (*PluginExecResponse) String added in v0.51.0

func (x *PluginExecResponse) String() string

func (*PluginExecResponse) UnmarshalJSON added in v0.51.0

func (x *PluginExecResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the PluginExecResponse from JSON.

func (*PluginExecResponse) UnmarshalProtoJSON added in v0.51.0

func (x *PluginExecResponse) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the PluginExecResponse message from JSON.

func (*PluginExecResponse) UnmarshalVT added in v0.51.0

func (m *PluginExecResponse) UnmarshalVT(dAtA []byte) error

type Registry

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

Registry maps exec config IDs to handler factories.

func NewDefaultRegistry

func NewDefaultRegistry() *Registry

NewDefaultRegistry creates a registry with all built-in space exec handlers.

func NewDefaultRegistryWithBus added in v0.51.0

func NewDefaultRegistryWithBus(b bus.Bus) *Registry

NewDefaultRegistryWithBus creates a registry with all built-in space exec handlers, including handlers that need the controller bus.

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates an empty registry.

func (*Registry) ConfigIDs

func (r *Registry) ConfigIDs() []string

ConfigIDs returns all registered config IDs.

func (*Registry) CreateHandler

func (r *Registry) CreateHandler(
	ctx context.Context,
	le *logrus.Entry,
	ws world.WorldState,
	handle forge_target.ExecControllerHandle,
	inputs forge_target.InputMap,
	configID string,
	configData []byte,
) (Handler, error)

CreateHandler looks up and constructs a handler for the given config ID.

func (*Registry) Lookup

func (r *Registry) Lookup(configID string) HandlerFactory

Lookup returns the factory for the given config ID, or nil if not found.

func (*Registry) Register

func (r *Registry) Register(configID string, factory HandlerFactory)

Register adds a handler factory for the given config ID.

type SRPCPluginExecServiceClient added in v0.51.0

type SRPCPluginExecServiceClient interface {
	// SRPCClient returns the underlying SRPC client.
	SRPCClient() srpc.Client

	// Execute runs a plugin-owned execution controller.
	Execute(ctx context.Context, in *PluginExecRequest) (*PluginExecResponse, error)
	// ExecuteStream runs a plugin-owned execution controller and streams logs.
	ExecuteStream(ctx context.Context, in *PluginExecRequest) (SRPCPluginExecService_ExecuteStreamClient, error)
}

func NewSRPCPluginExecServiceClient added in v0.51.0

func NewSRPCPluginExecServiceClient(cc srpc.Client) SRPCPluginExecServiceClient

func NewSRPCPluginExecServiceClientWithServiceID added in v0.51.0

func NewSRPCPluginExecServiceClientWithServiceID(cc srpc.Client, serviceID string) SRPCPluginExecServiceClient

type SRPCPluginExecServiceHandler added in v0.51.0

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

func (SRPCPluginExecServiceHandler) GetMethodIDs added in v0.51.0

func (SRPCPluginExecServiceHandler) GetMethodIDs() []string

func (*SRPCPluginExecServiceHandler) GetServiceID added in v0.51.0

func (d *SRPCPluginExecServiceHandler) GetServiceID() string

func (*SRPCPluginExecServiceHandler) InvokeMethod added in v0.51.0

func (d *SRPCPluginExecServiceHandler) InvokeMethod(
	serviceID, methodID string,
	strm srpc.Stream,
) (bool, error)

func (SRPCPluginExecServiceHandler) InvokeMethod_Execute added in v0.51.0

func (SRPCPluginExecServiceHandler) InvokeMethod_ExecuteStream added in v0.51.2

func (SRPCPluginExecServiceHandler) InvokeMethod_ExecuteStream(impl SRPCPluginExecServiceServer, strm srpc.Stream) error

type SRPCPluginExecServiceServer added in v0.51.0

type SRPCPluginExecServiceServer interface {
	// Execute runs a plugin-owned execution controller.
	Execute(context.Context, *PluginExecRequest) (*PluginExecResponse, error)
	// ExecuteStream runs a plugin-owned execution controller and streams logs.
	ExecuteStream(*PluginExecRequest, SRPCPluginExecService_ExecuteStreamStream) error
}

type SRPCPluginExecService_ExecuteStream added in v0.51.0

type SRPCPluginExecService_ExecuteStream interface {
	srpc.Stream
}

type SRPCPluginExecService_ExecuteStreamClient added in v0.51.2

type SRPCPluginExecService_ExecuteStreamClient interface {
	srpc.Stream
	Recv() (*PluginExecResponse, error)
	RecvTo(*PluginExecResponse) error
}

type SRPCPluginExecService_ExecuteStreamStream added in v0.51.2

type SRPCPluginExecService_ExecuteStreamStream interface {
	srpc.Stream
	Send(*PluginExecResponse) error
	SendAndClose(*PluginExecResponse) error
}

type SpaceExecConfig

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

SpaceExecConfig is a generic config type for space-exec handlers. It wraps raw config data bytes and a config ID, satisfying the config.Config, protobuf_go_lite.Message, and block.Block interfaces.

The actual config deserialization happens inside each HandlerFactory, so this type just carries the raw bytes through the controllerbus config resolution pipeline (LoadConfigConstructorByID -> Resolve -> LoadFactoryByConfig -> Construct).

func NewSpaceExecConfig

func NewSpaceExecConfig(configID string) *SpaceExecConfig

NewSpaceExecConfig constructs a SpaceExecConfig with the given config ID.

func (*SpaceExecConfig) EqualsConfig

func (c *SpaceExecConfig) EqualsConfig(other config.Config) bool

EqualsConfig checks equality by config ID and data.

func (*SpaceExecConfig) GetConfigID

func (c *SpaceExecConfig) GetConfigID() string

GetConfigID returns the config ID.

func (*SpaceExecConfig) MarshalBlock

func (c *SpaceExecConfig) MarshalBlock() ([]byte, error)

MarshalBlock returns the raw data for block storage.

func (*SpaceExecConfig) MarshalJSON

func (c *SpaceExecConfig) MarshalJSON() ([]byte, error)

MarshalJSON returns the raw data (assumed JSON or empty).

func (*SpaceExecConfig) MarshalToSizedBufferVT

func (c *SpaceExecConfig) MarshalToSizedBufferVT(buf []byte) (int, error)

MarshalToSizedBufferVT marshals to a pre-allocated buffer.

func (*SpaceExecConfig) MarshalVT

func (c *SpaceExecConfig) MarshalVT() ([]byte, error)

MarshalVT returns the raw data.

func (*SpaceExecConfig) Reset

func (c *SpaceExecConfig) Reset()

Reset clears the data.

func (*SpaceExecConfig) SizeVT

func (c *SpaceExecConfig) SizeVT() int

SizeVT returns the size of the data.

func (*SpaceExecConfig) UnmarshalBlock

func (c *SpaceExecConfig) UnmarshalBlock(data []byte) error

UnmarshalBlock stores the raw block data.

func (*SpaceExecConfig) UnmarshalJSON

func (c *SpaceExecConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON stores the raw JSON bytes.

func (*SpaceExecConfig) UnmarshalVT

func (c *SpaceExecConfig) UnmarshalVT(data []byte) error

UnmarshalVT stores the raw protobuf bytes.

func (*SpaceExecConfig) Validate

func (c *SpaceExecConfig) Validate() error

Validate returns nil; validation happens in the handler factory.

Jump to

Keyboard shortcuts

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