plugin_space

package
v0.57.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ConfigID = ControllerID

ConfigID is the config identifier.

View Source
const ControllerID = "plugin/space"

ControllerID is the controller ID.

Variables

View Source
var ErrEmptySpaceID = errors.New("space_id must be specified")

ErrEmptySpaceID is returned when space_id is empty.

View Source
var Version = controller.MustParseVersion("0.0.1")

Version is the version of this controller.

Functions

func NewFactory

func NewFactory(b bus.Bus, opts ...FactoryOption) 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

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

HandleDirective asks if the handler can resolve the directive.

type Config

type Config struct {

	// SpaceId is the Space identifier.
	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 plugins and resolves FetchManifest directives by watching the Space world.

func (*Config) CloneMessageVT

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

func (*Config) CloneVT

func (m *Config) CloneVT() *Config

func (*Config) EqualMessageVT

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

func (*Config) EqualVT

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

func (*Config) EqualsConfig

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

EqualsConfig checks if the config is equal to another.

func (*Config) GetConfigID

func (c *Config) GetConfigID() string

GetConfigID returns the unique string for this configuration type.

func (*Config) GetEngineId

func (x *Config) GetEngineId() string

func (*Config) GetHostPluginId added in v0.51.2

func (x *Config) GetHostPluginId() string

func (*Config) GetObjectKeys

func (x *Config) GetObjectKeys() []string

func (*Config) GetObjectStoreId

func (x *Config) GetObjectStoreId() string

func (*Config) GetPluginIds

func (x *Config) GetPluginIds() []string

func (*Config) GetSessionPeerId

func (x *Config) GetSessionPeerId() string

func (*Config) GetSpaceId

func (x *Config) GetSpaceId() string

func (*Config) GetVolumeId

func (x *Config) GetVolumeId() string

func (*Config) GetWorldBucketId added in v0.51.2

func (x *Config) GetWorldBucketId() string

func (*Config) MarshalJSON

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

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 (x *Config) MarshalProtoText() string

func (*Config) MarshalToSizedBufferVT

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

func (*Config) MarshalToVT

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

func (*Config) MarshalVT

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

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) Reset

func (x *Config) Reset()

func (*Config) SizeVT

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

func (*Config) String

func (x *Config) String() string

func (*Config) UnmarshalJSON

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

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

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

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration.

type Controller

type Controller struct {
	*bus.BusController[*Config]
	// contains filtered or unexported fields
}

Controller loads plugins for a Space and resolves FetchManifest directives by watching the Space world.

Watches SpaceSettings in the Space world reactively. When plugin_ids change in SpaceSettings, reconciles LoadPlugin directives: adds directives for new plugins and releases directives for removed plugins.

For FetchManifest: resolves FetchManifest directives for manifest IDs matching the current SpaceSettings plugin_ids. Uses a shared world watch loop with broadcast to handle resolver set changes.

Also reconciles process bindings: starts enabled persistent processes and stops processes that are removed or disabled.

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 when they 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 external state changes.

type FactoryOption added in v0.57.2

type FactoryOption func(*factoryConfig)

FactoryOption configures a Space plugin controller factory.

func WithLoadTarget added in v0.57.2

func WithLoadTarget(target bus.Bus) FactoryOption

WithLoadTarget sends approved Space plugin load directives to target.

func WithManifestSource added in v0.57.2

func WithManifestSource(source bus.Bus) FactoryOption

WithManifestSource permits approved Space plugins to fetch manifests from source.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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