Documentation
¶
Index ¶
- Constants
- Variables
- func NewFactory(b bus.Bus) controller.Factory
- type CloudBlockStoreForwarder
- func (c *CloudBlockStoreForwarder) Close() error
- func (c *CloudBlockStoreForwarder) Execute(ctx context.Context) error
- func (c *CloudBlockStoreForwarder) GetControllerInfo() *controller.Info
- func (c *CloudBlockStoreForwarder) HandleDirective(context.Context, directive.Instance) ([]directive.Resolver, error)
- type Config
- func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *Config) CloneVT() *Config
- func (this *Config) EqualMessageVT(thatMsg any) bool
- func (this *Config) EqualVT(that *Config) bool
- func (c *Config) EqualsConfig(other config.Config) bool
- func (c *Config) GetConfigID() string
- func (x *Config) GetEngineId() string
- func (x *Config) GetHostPluginId() string
- func (x *Config) GetObjectKeys() []string
- func (x *Config) GetObjectStoreId() string
- func (x *Config) GetPluginIds() []string
- func (x *Config) GetSessionPeerId() string
- func (x *Config) GetSpaceId() string
- func (x *Config) GetVolumeId() string
- func (x *Config) GetWorldBucketId() string
- func (x *Config) MarshalJSON() ([]byte, error)
- func (x *Config) MarshalProtoJSON(s *json.MarshalState)
- func (x *Config) MarshalProtoText() string
- func (m *Config) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Config) MarshalToVT(dAtA []byte) (int, error)
- func (m *Config) MarshalVT() (dAtA []byte, err error)
- func (*Config) ProtoMessage()
- func (x *Config) Reset()
- func (m *Config) SizeVT() (n int)
- func (x *Config) String() string
- func (x *Config) UnmarshalJSON(b []byte) error
- func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *Config) UnmarshalVT(dAtA []byte) error
- func (c *Config) Validate() error
- type Controller
Constants ¶
const ConfigID = ControllerID
ConfigID is the config identifier.
const ControllerID = "plugin/space"
ControllerID is the controller ID.
Variables ¶
var ErrEmptySpaceID = errors.New("space_id must be specified")
ErrEmptySpaceID is returned when space_id is empty.
var Version = semver.MustParse("0.0.1")
Version is the version of this controller.
Functions ¶
func NewFactory ¶
func NewFactory(b bus.Bus) controller.Factory
NewFactory constructs the component factory.
Types ¶
type CloudBlockStoreForwarder ¶ added in v0.51.2
type CloudBlockStoreForwarder struct {
// contains filtered or unexported fields
}
CloudBlockStoreForwarder forwards the mounted Space bucket to the plugin host.
func NewCloudBlockStoreForwarder ¶ added in v0.51.2
func NewCloudBlockStoreForwarder( le *logrus.Entry, b bus.Bus, spaceID string, bucketID string, pluginID string, ) *CloudBlockStoreForwarder
NewCloudBlockStoreForwarder constructs a cloud block store forwarding controller.
func (*CloudBlockStoreForwarder) Close ¶ added in v0.51.2
func (c *CloudBlockStoreForwarder) Close() error
Close releases resources used by the controller.
func (*CloudBlockStoreForwarder) Execute ¶ added in v0.51.2
func (c *CloudBlockStoreForwarder) Execute(ctx context.Context) error
Execute executes the controller goroutine.
func (*CloudBlockStoreForwarder) GetControllerInfo ¶ added in v0.51.2
func (c *CloudBlockStoreForwarder) GetControllerInfo() *controller.Info
GetControllerInfo returns information about the controller.
func (*CloudBlockStoreForwarder) HandleDirective ¶ added in v0.51.2
func (c *CloudBlockStoreForwarder) HandleDirective(context.Context, directive.Instance) ([]directive.Resolver, error)
HandleDirective asks if the handler can resolve the directive.
type Config ¶
type Config struct {
// SpaceId is the Space identifier for approval lookups.
SpaceId string `protobuf:"bytes,1,opt,name=space_id,json=spaceId,proto3" json:"spaceId,omitempty"`
// PluginIds lists manifest IDs of plugins to load (from SpaceSettings).
PluginIds []string `protobuf:"bytes,2,rep,name=plugin_ids,json=pluginIds,proto3" json:"pluginIds,omitempty"`
// VolumeId is the volume ID for the PlatformAccount object store.
// If empty, uses the default bldr plugin volume.
VolumeId string `protobuf:"bytes,3,opt,name=volume_id,json=volumeId,proto3" json:"volumeId,omitempty"`
// ObjectStoreId is the object store ID within the volume.
// If empty, uses "platform-account".
ObjectStoreId string `protobuf:"bytes,4,opt,name=object_store_id,json=objectStoreId,proto3" json:"objectStoreId,omitempty"`
// EngineId is the Hydra engine ID for watching the Space world.
// Required for FetchManifest resolution.
EngineId string `protobuf:"bytes,5,opt,name=engine_id,json=engineId,proto3" json:"engineId,omitempty"`
// ObjectKeys is the list of object keys to collect manifests from.
ObjectKeys []string `protobuf:"bytes,6,rep,name=object_keys,json=objectKeys,proto3" json:"objectKeys,omitempty"`
// SessionPeerId is the base58-encoded peer ID of the local session.
// Used by ObjectType factories that need session-scoped behavior
// (e.g., ForgeWorkerFactory checks if this session should run the worker).
SessionPeerId string `protobuf:"bytes,7,opt,name=session_peer_id,json=sessionPeerId,proto3" json:"sessionPeerId,omitempty"`
// WorldBucketId is the bucket ID backing the mounted Space world.
// If set, the controller forwards this block store to the plugin host.
WorldBucketId string `protobuf:"bytes,8,opt,name=world_bucket_id,json=worldBucketId,proto3" json:"worldBucketId,omitempty"`
// HostPluginId is the plugin ID of the host that mounts this Space.
// Required when world_bucket_id is set so the forwarded block store
// configset registers under the correct plugin service prefix.
HostPluginId string `protobuf:"bytes,9,opt,name=host_plugin_id,json=hostPluginId,proto3" json:"hostPluginId,omitempty"`
// contains filtered or unexported fields
}
Config configures the Space Plugin Controller. Loads approved plugins and resolves FetchManifest directives by watching the Space world with approval gating.
func (*Config) CloneMessageVT ¶
func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*Config) EqualMessageVT ¶
func (*Config) EqualsConfig ¶
EqualsConfig checks if the config is equal to another.
func (*Config) GetConfigID ¶
GetConfigID returns the unique string for this configuration type.
func (*Config) GetEngineId ¶
func (*Config) GetHostPluginId ¶ added in v0.51.2
func (*Config) GetObjectKeys ¶
func (*Config) GetObjectStoreId ¶
func (*Config) GetPluginIds ¶
func (*Config) GetSessionPeerId ¶
func (*Config) GetSpaceId ¶
func (*Config) GetVolumeId ¶
func (*Config) GetWorldBucketId ¶ added in v0.51.2
func (*Config) MarshalJSON ¶
MarshalJSON marshals the Config to JSON.
func (*Config) MarshalProtoJSON ¶
func (x *Config) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the Config message to JSON.
func (*Config) MarshalProtoText ¶
func (*Config) MarshalToSizedBufferVT ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) UnmarshalJSON ¶
UnmarshalJSON unmarshals the Config from JSON.
func (*Config) UnmarshalProtoJSON ¶
func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the Config message from JSON.
func (*Config) UnmarshalVT ¶
type Controller ¶
type Controller struct {
*bus.BusController[*Config]
// contains filtered or unexported fields
}
Controller loads approved plugins for a Space and resolves FetchManifest directives by watching the Space world with approval gating.
Watches SpaceSettings in the Space world reactively. When plugin_ids change in SpaceSettings, reconciles LoadPlugin directives: adds directives for newly-approved plugins, releases directives for removed plugins.
For FetchManifest: resolves FetchManifest directives for manifest IDs matching the current SpaceSettings plugin_ids. Checks approval before returning manifest values. Uses a shared world watch loop with broadcast to handle resolver set changes.
Also reconciles process bindings: starts approved persistent processes and stops processes that are removed or unapproved.
func StartControllerWithConfig ¶
func StartControllerWithConfig( ctx context.Context, b bus.Bus, conf *Config, rel func(), ) (*Controller, directive.Instance, directive.Reference, error)
StartControllerWithConfig starts the space plugin controller with a config. Waits for the controller to start running. Returns a Release function to close the controller when done.
func (*Controller) Execute ¶
func (c *Controller) Execute(ctx context.Context) error
Execute executes the controller goroutine.
func (*Controller) GetLoadedPluginIDsAndWaitCh ¶ added in v0.51.2
func (c *Controller) GetLoadedPluginIDsAndWaitCh() ([]string, <-chan struct{})
GetLoadedPluginIDsAndWaitCh returns loaded plugin IDs and a channel closed on controller state change.
func (*Controller) HandleDirective ¶
func (c *Controller) HandleDirective(ctx context.Context, di directive.Instance) ([]directive.Resolver, error)
HandleDirective asks if the handler can resolve the directive.
func (*Controller) NotifyChanged ¶
func (c *Controller) NotifyChanged()
NotifyChanged wakes the watch loop to reconcile approval-backed state.