bldr_plugin

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: 31 Imported by: 0

README

Plugins

Plugins communicate using staRPC services.

The host manages loading plugins, and exposes an API for plugins to declare dependencies on other plugins and to update plugin binaries.

The root plugin is the initial plugin loaded by the host. It should expose a RPC service which the host calls to resolve plugin binaries on-demand.

Documentation

Index

Constants

View Source
const BldrHttpPrefix = "/b/"

BldrHttpPrefix is the route prefix for bldr-controlled URL space. /b/

View Source
const HostServerIDPrefix = "plugin-host/"

HostServerIDPrefix is the server ID prefix used for plugin-host originating RPC calls.

View Source
const HostServiceIDPrefix = "plugin-host/"

HostServiceIDPrefix is the prefix used for the plugin-host RPC services. This ID can be prepended to RPC service IDs to indicate the service is located on the plugin host (while running as a plugin).

View Source
const HostStorageID = "default"

HostStorageID is the storage ID to use for the plugin host within a plugin.

View Source
const HostVolumeServiceIDPrefix = "host-volume/"

HostVolumeServiceIDPrefix is the service ID prefix for the host ProxyVolume.

View Source
const PluginAssetsFsIdPrefix = "plugin-assets/"

PluginAssetsFsIdPrefix is the prefix to use for the plugin assets unixfs id on the plugin bus.

View Source
const PluginAssetsHttpPrefix = BldrHttpPrefix + "pa/"

PluginAssetsHttpPrefix is the route prefix to use for plugin assets. /b/pa/{plugin-id}

View Source
const PluginAssetsServiceID = "plugin-assets/unixfs.rpc.FSCursorService"

PluginAssetsServiceID is the service id for the plugin assets fs rpc service.

This service is exposed by the plugin host to the plugin.

View Source
const PluginAssetsWebPkgsDir = "bldr-web-pkgs"

PluginAssetsWebPkgsDir is the directory within assets fs for web pkgs.

View Source
const PluginDistFsIdPrefix = "plugin-dist/"

PluginDistFsIdPrefix is the prefix to use for the plugin dist unixfs id on the plugin bus.

View Source
const PluginDistHttpPrefix = BldrHttpPrefix + "pd/"

PluginDistHttpPrefix is the route prefix to use for plugin dist. /b/pd/{plugin-id}

View Source
const PluginDistServiceID = "plugin-dist/unixfs.rpc.FSCursorService"

PluginDistServiceID is the service id for the plugin dist fs rpc service.

This service is exposed by the plugin host to the plugin.

View Source
const PluginHttpPrefix = "/p/"

PluginHttpPrefix is the route prefix for plugin-controlled URL space. /p/{pluginId}/

View Source
const PluginServerIDPrefix = "plugin/"

PluginServerIDPrefix is the server id prefix for plugins. Incoming RPC calls from other plugins will have ServerID=PluginServerIDPrefix+RemotePluginID

View Source
const PluginServiceIDPrefix = "plugin/"

PluginServiceIDPrefix is the prefix used for calling services on other plugins.

ID can be prepended to RPC service IDs to indicate the service is located on another plugin.

For example: LookupRpcService<plugin/foo/my.Service> will access the my.Service service on the plugin with ID "foo".

View Source
const PluginVolumeID = "plugin-host"

PluginVolumeID is an alias to the host volume (while running as a plugin).

View Source
const PluginWebPkgHttpPrefix = BldrHttpPrefix + "pkg/"

PluginWebPkgHttpPrefix is the public URL path prefix for web packages. /b/pkg/

View Source
const QuickJSHttpPrefix = BldrHttpPrefix + "qjs/"

QuickJSHttpPrefix is the public URL path prefix for QuickJS runtime files. /b/qjs/

View Source
const SRPCPluginHostServiceID = "bldr.plugin.PluginHost"
View Source
const SRPCPluginServiceID = "bldr.plugin.Plugin"

Variables

View Source
var (
	PluginState_name = map[int32]string{
		0: "PluginState_UNKNOWN",
		1: "PluginState_REQUESTED",
		2: "PluginState_RUNNING",
	}
	PluginState_value = map[string]int32{
		"PluginState_UNKNOWN":   0,
		"PluginState_REQUESTED": 1,
		"PluginState_RUNNING":   2,
	}
)

Enum value maps for PluginState.

View Source
var ErrEmptyPluginID = errors.New("plugin id cannot be empty")

ErrEmptyPluginID is returned if the plugin ID was empty.

Functions

func BuildPluginRpcComponentID added in v0.51.0

func BuildPluginRpcComponentID(pluginID, instanceKey string) string

BuildPluginRpcComponentID builds the PluginRpc component id.

func ExPluginLoadAccess

func ExPluginLoadAccess(
	ctx context.Context,
	b bus.Bus,
	pluginID string,
	cb func(ctx context.Context, rp RunningPlugin) error,
) error

ExLoadPluginAccess calls LoadPlugin and returns the running plugin handle.

the callback will be canceled & restarted if the client becomes invalid. the callback context is canceled when the client value changes. the callback should return context.Canceled in that case.

if the callback returns nil, the outer function will also return nil.

func ExPluginLoadAccessClient

func ExPluginLoadAccessClient(
	ctx context.Context,
	b bus.Bus,
	pluginID string,
	cb func(ctx context.Context, c srpc.Client) error,
) error

ExLoadPluginAccessClient calls LoadPlugin and returns the rpc client.

the callback will be canceled & restarted if the client becomes invalid. the callback context is canceled when the client value changes. the callback should return context.Canceled in that case.

if the callback returns nil, the outer function will also return nil.

func ExPluginLoadInstancedWaitClient added in v0.51.0

func ExPluginLoadInstancedWaitClient(
	ctx context.Context,
	b bus.Bus,
	pluginID, instanceKey string,
	valDisposeCb func(),
) (srpc.Client, directive.Reference, error)

ExPluginLoadInstancedWaitClient calls LoadPlugin with an instance key and returns the rpc client to be set.

func ExPluginLoadWaitClient

func ExPluginLoadWaitClient(
	ctx context.Context,
	b bus.Bus,
	pluginID string,
	valDisposeCb func(),
) (srpc.Client, directive.Reference, error)

ExLoadPluginWaitClient calls LoadPlugin and returns the rpc client to be set. if returnIfIdle is set, returns nil, nil, nil if the directive becomes idle.

func HostServerID

func HostServerID(remoteServerID string) string

HostServerID constructs a server id for a component on the plugin host. remoteServerID can be empty

func NewSRPCPluginHandler

func NewSRPCPluginHandler(impl SRPCPluginServer, serviceID string) srpc.Handler

NewSRPCPluginHandler constructs a new RPC handler. serviceID: if empty, uses default: bldr.plugin.Plugin

func NewSRPCPluginHostHandler

func NewSRPCPluginHostHandler(impl SRPCPluginHostServer, serviceID string) srpc.Handler

NewSRPCPluginHostHandler constructs a new RPC handler. serviceID: if empty, uses default: bldr.plugin.PluginHost

func ParseHTTPPathPluginID

func ParseHTTPPathPluginID(httpPath string) (pluginID string, suffix string, err error)

ParseHTTPPathPluginID parses and validates a {plugin-id}/ prefix from a HTTP path.

func ParsePluginRpcComponentID added in v0.51.0

func ParsePluginRpcComponentID(componentID string) (string, string)

ParsePluginRpcComponentID parses the PluginRpc component id.

func ParsePluginUnixfsID

func ParsePluginUnixfsID(unixfsID string) (pluginID string, matchedPrefix string)

ParsePluginUnixfsID parses a unixfs ID and returns the plugin ID and matched prefix. Returns the plugin ID (which may be empty for current plugin) and the prefix. Returns empty matchedPrefix if no valid prefix is found.

Matches UnixFS IDs like: - plugin-dist: matches the current plugin dist fs - plugin-assets: matches the current plugin assets fs - plugin-dist/{plugin-id}: matches the plugin dist fs for plugin-id - plugin-assets/{plugin-id}: matches the plugin assets fs for plugin-id

func PluginAssetHTTPPath

func PluginAssetHTTPPath(pluginID string, httpPath string) string

PluginAssetHTTPPath adds the plugin asset file prefix to the given path.

func PluginAssetsFsId

func PluginAssetsFsId(pluginID string) string

PluginAssetsFsId returns the unixfs id for the assets filesystem for the given plugin id.

Calling with an empty pluginID uses the PluginAssetsFsIdPrefix, which is an alias to the current plugin's assets while running in a plugin.

func PluginDistFsId

func PluginDistFsId(pluginID string) string

PluginDistFsId returns the unixfs id for the dist filesystem for the given plugin id.

Calling with an empty pluginID uses the PluginDistFsIdPrefix, which is an alias to the current plugin's assets while running in a plugin.

func PluginDistHTTPPath

func PluginDistHTTPPath(pluginID, httpPath string) string

PluginDistHTTPPath adds the plugin distribution file prefix to the given path.

func PluginHTTPPath

func PluginHTTPPath(pluginID string, httpPaths ...string) string

PluginHTTPPath adds the plugin http prefix to the given path.

func PluginHTTPPathFromContext

func PluginHTTPPathFromContext(ctx context.Context, httpPath string) string

PluginHTTPPathFromContext detects the current plugin from the context and conditionally adds the plugin http path prefix to the given path.

func PluginServerID

func PluginServerID(pluginID, remoteServerID string) string

PluginServerID constructs a server id for a component on a plugin. remoteServerID can be empty

func PluginServiceID added in v0.51.2

func PluginServiceID(pluginID, serviceID string) string

PluginServiceID constructs a service id for routing to a service on a plugin.

func ResolveAccessUnixfs

ResolveAccessUnixfs resolves a AccessUnixfs directive with another plugin.

Resolves unixfs IDs like:

  • plugin-dist/{plugin-id}
  • plugin-assets/{plugin-id}

Returns nil, nil if the service ID does not match any of the known prefixes. Returns an error if the plugin id is invalid.

func ResolveLookupRpcClient

ResolveLookupRpcClient resolves a LookupRpcClient directive with a plugin or plugin host.

Resolves service IDs like:

  • plugin/{plugin-id}/{service id}
  • plugin-host/{service id}

Returns nil, nil if the service ID does not match any of the known prefixes. Returns an error if the plugin id is invalid.

func ResolveLookupRpcService

ResolveLookupRpcService resolves a LookupRpcService directive with a plugin or plugin host.

Resolves service IDs like:

  • plugin/{plugin-id}/{service id}
  • plugin-host/{service id}

Returns nil, nil if the service ID does not match any of the known prefixes. Returns an error if the plugin id is invalid.

func SRPCRegisterPlugin

func SRPCRegisterPlugin(mux srpc.Mux, impl SRPCPluginServer) error

SRPCRegisterPlugin registers the implementation with the mux. Uses the default serviceID: bldr.plugin.Plugin

func SRPCRegisterPluginHost

func SRPCRegisterPluginHost(mux srpc.Mux, impl SRPCPluginHostServer) error

SRPCRegisterPluginHost registers the implementation with the mux. Uses the default serviceID: bldr.plugin.PluginHost

func ValidatePluginID

func ValidatePluginID(id string, allowEmpty bool) error

ValidatePluginID validates a plugin ID.

func ValidatePluginUnixfsID

func ValidatePluginUnixfsID(unixfsID string, allowEmpty bool) (pluginID string, matchedPrefix string, err error)

ValidatePluginUnixfsID validates a plugin unixfs ID and returns the plugin ID and matched prefix. If allowEmpty is true, allows empty plugin ID which refers to current plugin. Returns an error if the unixfsID is invalid.

func WithPluginContextInfo

func WithPluginContextInfo(ctx context.Context, info *PluginContextInfo) context.Context

WithPluginContextInfo attaches plugin information to a context.

Types

type GetPluginInfoRequest

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

GetPluginInfoRequest is a request to return the information for the current plugin.

func (*GetPluginInfoRequest) CloneMessageVT

func (*GetPluginInfoRequest) CloneVT

func (*GetPluginInfoRequest) EqualMessageVT

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

func (*GetPluginInfoRequest) EqualVT

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

func (*GetPluginInfoRequest) MarshalJSON

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

MarshalJSON marshals the GetPluginInfoRequest to JSON.

func (*GetPluginInfoRequest) MarshalProtoJSON

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

MarshalProtoJSON marshals the GetPluginInfoRequest message to JSON.

func (*GetPluginInfoRequest) MarshalProtoText

func (x *GetPluginInfoRequest) MarshalProtoText() string

func (*GetPluginInfoRequest) MarshalToSizedBufferVT

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

func (*GetPluginInfoRequest) MarshalToVT

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

func (*GetPluginInfoRequest) MarshalVT

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

func (*GetPluginInfoRequest) ProtoMessage

func (*GetPluginInfoRequest) ProtoMessage()

func (*GetPluginInfoRequest) Reset

func (x *GetPluginInfoRequest) Reset()

func (*GetPluginInfoRequest) SizeVT

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

func (*GetPluginInfoRequest) String

func (x *GetPluginInfoRequest) String() string

func (*GetPluginInfoRequest) UnmarshalJSON

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

UnmarshalJSON unmarshals the GetPluginInfoRequest from JSON.

func (*GetPluginInfoRequest) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the GetPluginInfoRequest message from JSON.

func (*GetPluginInfoRequest) UnmarshalVT

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

type GetPluginInfoResponse

type GetPluginInfoResponse struct {

	// PluginId is the plugin identifier.
	PluginId string `protobuf:"bytes,1,opt,name=plugin_id,json=pluginId,proto3" json:"pluginId,omitempty"`
	// ManifestRef is the reference to the Manifest object.
	ManifestRef *manifest.ManifestRef `protobuf:"bytes,2,opt,name=manifest_ref,json=manifestRef,proto3" json:"manifestRef,omitempty"`
	// HostVolumeInfo is the information for the host Volume.
	// The volume is exposed with a ProxyVolume.
	HostVolumeInfo *volume.VolumeInfo `protobuf:"bytes,3,opt,name=host_volume_info,json=hostVolumeInfo,proto3" json:"hostVolumeInfo,omitempty"`
	// contains filtered or unexported fields
}

GetPluginInfoResponse is the response to the GetPluginInfo request.

func (*GetPluginInfoResponse) CloneMessageVT

func (*GetPluginInfoResponse) CloneVT

func (*GetPluginInfoResponse) EqualMessageVT

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

func (*GetPluginInfoResponse) EqualVT

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

func (*GetPluginInfoResponse) GetHostVolumeInfo

func (x *GetPluginInfoResponse) GetHostVolumeInfo() *volume.VolumeInfo

func (*GetPluginInfoResponse) GetManifestRef

func (x *GetPluginInfoResponse) GetManifestRef() *manifest.ManifestRef

func (*GetPluginInfoResponse) GetPluginId

func (x *GetPluginInfoResponse) GetPluginId() string

func (*GetPluginInfoResponse) MarshalJSON

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

MarshalJSON marshals the GetPluginInfoResponse to JSON.

func (*GetPluginInfoResponse) MarshalProtoJSON

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

MarshalProtoJSON marshals the GetPluginInfoResponse message to JSON.

func (*GetPluginInfoResponse) MarshalProtoText

func (x *GetPluginInfoResponse) MarshalProtoText() string

func (*GetPluginInfoResponse) MarshalToSizedBufferVT

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

func (*GetPluginInfoResponse) MarshalToVT

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

func (*GetPluginInfoResponse) MarshalVT

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

func (*GetPluginInfoResponse) ProtoMessage

func (*GetPluginInfoResponse) ProtoMessage()

func (*GetPluginInfoResponse) Reset

func (x *GetPluginInfoResponse) Reset()

func (*GetPluginInfoResponse) SizeVT

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

func (*GetPluginInfoResponse) String

func (x *GetPluginInfoResponse) String() string

func (*GetPluginInfoResponse) UnmarshalJSON

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

UnmarshalJSON unmarshals the GetPluginInfoResponse from JSON.

func (*GetPluginInfoResponse) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the GetPluginInfoResponse message from JSON.

func (*GetPluginInfoResponse) UnmarshalVT

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

type LoadPlugin

type LoadPlugin interface {
	// Directive indicates LoadPlugin is a directive.
	directive.Directive

	// LoadPluginID returns the plugin ID to load.
	// Cannot be empty.
	LoadPluginID() string

	// LoadPluginInstanceKey returns the instance key for instanced plugins.
	// When non-empty, (plugin_id, instance_key) is the composite deduplication
	// key, creating a separate worker per instance.
	// When empty, a single shared instance per plugin_id is used.
	LoadPluginInstanceKey() string
}

LoadPlugin is a directive to execute a plugin by ID using the best available host.

func NewLoadPlugin

func NewLoadPlugin(pluginID string) LoadPlugin

NewLoadPlugin constructs a new LoadPlugin directive.

func NewLoadPluginInstanced

func NewLoadPluginInstanced(pluginID, instanceKey string) LoadPlugin

NewLoadPluginInstanced constructs a new LoadPlugin directive with an instance key.

type LoadPluginRequest

type LoadPluginRequest struct {

	// PluginId is the plugin identifier to load.
	PluginId string `protobuf:"bytes,1,opt,name=plugin_id,json=pluginId,proto3" json:"pluginId,omitempty"`
	// InstanceKey is an optional key for instanced plugins.
	// When non-empty, the plugin host uses (plugin_id, instance_key) as the
	// composite deduplication key, allowing multiple independent instances of the
	// same plugin to run concurrently in separate workers.
	// When empty, behavior is unchanged: a single shared instance per plugin_id.
	InstanceKey string `protobuf:"bytes,2,opt,name=instance_key,json=instanceKey,proto3" json:"instanceKey,omitempty"`
	// contains filtered or unexported fields
}

LoadPluginRequest is a request to load a plugin while the RPC is active.

func (*LoadPluginRequest) CloneMessageVT

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

func (*LoadPluginRequest) CloneVT

func (m *LoadPluginRequest) CloneVT() *LoadPluginRequest

func (*LoadPluginRequest) EqualMessageVT

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

func (*LoadPluginRequest) EqualVT

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

func (*LoadPluginRequest) GetInstanceKey

func (x *LoadPluginRequest) GetInstanceKey() string

func (*LoadPluginRequest) GetPluginId

func (x *LoadPluginRequest) GetPluginId() string

func (*LoadPluginRequest) MarshalJSON

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

MarshalJSON marshals the LoadPluginRequest to JSON.

func (*LoadPluginRequest) MarshalProtoJSON

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

MarshalProtoJSON marshals the LoadPluginRequest message to JSON.

func (*LoadPluginRequest) MarshalProtoText

func (x *LoadPluginRequest) MarshalProtoText() string

func (*LoadPluginRequest) MarshalToSizedBufferVT

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

func (*LoadPluginRequest) MarshalToVT

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

func (*LoadPluginRequest) MarshalVT

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

func (*LoadPluginRequest) ProtoMessage

func (*LoadPluginRequest) ProtoMessage()

func (*LoadPluginRequest) Reset

func (x *LoadPluginRequest) Reset()

func (*LoadPluginRequest) SizeVT

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

func (*LoadPluginRequest) String

func (x *LoadPluginRequest) String() string

func (*LoadPluginRequest) UnmarshalJSON

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

UnmarshalJSON unmarshals the LoadPluginRequest from JSON.

func (*LoadPluginRequest) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the LoadPluginRequest message from JSON.

func (*LoadPluginRequest) UnmarshalVT

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

func (*LoadPluginRequest) Validate

func (r *LoadPluginRequest) Validate() error

Validate validates the LoadPlugin request.

type LoadPluginResponse

type LoadPluginResponse struct {

	// PluginStatus contains the current plugin status object.
	PluginStatus *PluginStatus `protobuf:"bytes,1,opt,name=plugin_status,json=pluginStatus,proto3" json:"pluginStatus,omitempty"`
	// contains filtered or unexported fields
}

LoadPluginResponse is a status response to a LoadPlugin request.

func (*LoadPluginResponse) CloneMessageVT

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

func (*LoadPluginResponse) CloneVT

func (m *LoadPluginResponse) CloneVT() *LoadPluginResponse

func (*LoadPluginResponse) EqualMessageVT

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

func (*LoadPluginResponse) EqualVT

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

func (*LoadPluginResponse) GetPluginStatus

func (x *LoadPluginResponse) GetPluginStatus() *PluginStatus

func (*LoadPluginResponse) MarshalJSON

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

MarshalJSON marshals the LoadPluginResponse to JSON.

func (*LoadPluginResponse) MarshalProtoJSON

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

MarshalProtoJSON marshals the LoadPluginResponse message to JSON.

func (*LoadPluginResponse) MarshalProtoText

func (x *LoadPluginResponse) MarshalProtoText() string

func (*LoadPluginResponse) MarshalToSizedBufferVT

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

func (*LoadPluginResponse) MarshalToVT

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

func (*LoadPluginResponse) MarshalVT

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

func (*LoadPluginResponse) ProtoMessage

func (*LoadPluginResponse) ProtoMessage()

func (*LoadPluginResponse) Reset

func (x *LoadPluginResponse) Reset()

func (*LoadPluginResponse) SizeVT

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

func (*LoadPluginResponse) String

func (x *LoadPluginResponse) String() string

func (*LoadPluginResponse) UnmarshalJSON

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

UnmarshalJSON unmarshals the LoadPluginResponse from JSON.

func (*LoadPluginResponse) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the LoadPluginResponse message from JSON.

func (*LoadPluginResponse) UnmarshalVT

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

type LoadPluginValue

type LoadPluginValue = RunningPlugin

LoadPluginValue is the result type for LoadPlugin. Multiple results may be pushed to the directive.

func ExLoadPlugin

func ExLoadPlugin(
	ctx context.Context,
	b bus.Bus,
	returnIfIdle bool,
	pluginID string,
	valDisposeCallback func(),
) (LoadPluginValue, directive.Instance, directive.Reference, error)

ExLoadPlugin executes the LoadPlugin directive.

if returnIfIdle=true and the directive becomes idle, returns nil, nil, nil

func ExLoadPluginInstanced

func ExLoadPluginInstanced(
	ctx context.Context,
	b bus.Bus,
	returnIfIdle bool,
	pluginID, instanceKey string,
	valDisposeCallback func(),
) (LoadPluginValue, directive.Instance, directive.Reference, error)

ExLoadPluginInstanced executes the LoadPlugin directive with an instance key.

type LookupRpcClientHandler

type LookupRpcClientHandler interface {
	// WaitPluginHostClient waits for an RPC client for the plugin host.
	//
	// Released is a function to call if the client becomes invalid.
	// Returns nil, nil, err if any error.
	// Returns nil, nil, nil to skip resolving the client.
	// Otherwise returns client, releaseFunc, nil
	WaitPluginHostClient(ctx context.Context, released func()) (srpc.Client, func(), error)

	// WaitPluginClient waits for an RPC client for a plugin.
	//
	// Released is a function to call if the client becomes invalid.
	// Returns nil, nil, err if any error.
	// Returns nil, nil, nil to skip resolving the client.
	// Otherwise returns client, releaseFunc, nil
	WaitPluginClient(ctx context.Context, released func(), pluginID string) (srpc.Client, func(), error)
}

LookupRpcClientHandler handles callbacks for LookupRpcClientResolver.

type LookupRpcClientResolver

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

LookupRpcClientResolver resolves LookupRpcClient with the plugin or plugin host.

Resolves service IDs like:

  • plugin/{plugin-id}/{service id}
  • plugin-host/{service id}

func NewLookupRpcClientResolver

func NewLookupRpcClientResolver(h LookupRpcClientHandler, pluginID, stripServiceIDPrefix string) *LookupRpcClientResolver

NewLookupRpcClientResolver constructs a new LookupRpcClientResolver.

Usually you will want to use ResolveLookupRpcClient instead. If pluginID is empty, addresses the plugin host. stripServiceIDPrefix is the prefix to strip from the service id, if any

func (*LookupRpcClientResolver) GetRpcClientCtr

func (r *LookupRpcClientResolver) GetRpcClientCtr() *ccontainer.CContainer[*srpc.Client]

GetRpcClientCtr returns the rpc client container. The RPC client will be set when it becomes ready.

func (*LookupRpcClientResolver) Resolve

Resolve resolves the values, emitting them to the handler.

type LookupRpcServiceResolver

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

LookupRpcServiceResolver resolves LookupRpcService with the plugin or plugin host.

Resolves service IDs like:

  • plugin/{plugin-id}/{service id}
  • plugin-host/{service id}

func NewLookupRpcServiceResolver

func NewLookupRpcServiceResolver(h LookupRpcClientHandler, pluginID, stripServiceIDPrefix string) *LookupRpcServiceResolver

NewLookupRpcServiceResolver constructs a new LookupRpcServiceResolver.

Usually you will want to use ResolveLookupRpcService instead. If pluginID is empty, addresses the plugin host. stripServiceIDPrefix is the prefix to strip from the service id, if any

func (*LookupRpcServiceResolver) Resolve

Resolve resolves the values, emitting them to the handler.

type PluginContextInfo

type PluginContextInfo struct {

	// PluginMeta is the plugin metadata.
	PluginMeta *PluginMeta `protobuf:"bytes,1,opt,name=plugin_meta,json=pluginMeta,proto3" json:"pluginMeta,omitempty"`
	// contains filtered or unexported fields
}

PluginContextInfo contains information about the running plugin attached to the Context tree for access within controllers running on the plugin bus.

func GetPluginContextInfo

func GetPluginContextInfo(ctx context.Context) *PluginContextInfo

GetPluginContextInfo retrieves plugin information from a context. May return nil.

func NewPluginContextInfo

func NewPluginContextInfo(meta *PluginMeta) *PluginContextInfo

NewPluginContextInfo constructs a new PluginContextInfo object.

func (*PluginContextInfo) CloneMessageVT

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

func (*PluginContextInfo) CloneVT

func (m *PluginContextInfo) CloneVT() *PluginContextInfo

func (*PluginContextInfo) EqualMessageVT

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

func (*PluginContextInfo) EqualVT

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

func (*PluginContextInfo) GetPluginMeta

func (x *PluginContextInfo) GetPluginMeta() *PluginMeta

func (*PluginContextInfo) MarshalJSON

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

MarshalJSON marshals the PluginContextInfo to JSON.

func (*PluginContextInfo) MarshalProtoJSON

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

MarshalProtoJSON marshals the PluginContextInfo message to JSON.

func (*PluginContextInfo) MarshalProtoText

func (x *PluginContextInfo) MarshalProtoText() string

func (*PluginContextInfo) MarshalToSizedBufferVT

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

func (*PluginContextInfo) MarshalToVT

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

func (*PluginContextInfo) MarshalVT

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

func (*PluginContextInfo) ProtoMessage

func (*PluginContextInfo) ProtoMessage()

func (*PluginContextInfo) Reset

func (x *PluginContextInfo) Reset()

func (*PluginContextInfo) SizeVT

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

func (*PluginContextInfo) String

func (x *PluginContextInfo) String() string

func (*PluginContextInfo) UnmarshalJSON

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

UnmarshalJSON unmarshals the PluginContextInfo from JSON.

func (*PluginContextInfo) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the PluginContextInfo message from JSON.

func (*PluginContextInfo) UnmarshalVT

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

func (*PluginContextInfo) Validate

func (i *PluginContextInfo) Validate() error

Validate validates the context info.

type PluginMeta

type PluginMeta struct {

	// ProjectId is the project identifier.
	// Must be a valid-dns-label.
	ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"projectId,omitempty"`
	// PluginId is the plugin identifier.
	// Must be a valid-dns-label.
	PluginId string `protobuf:"bytes,2,opt,name=plugin_id,json=pluginId,proto3" json:"pluginId,omitempty"`
	// PlatformId is the destination platform ID.
	PlatformId string `protobuf:"bytes,3,opt,name=platform_id,json=platformId,proto3" json:"platformId,omitempty"`
	// BuildType is the type of build this is.
	BuildType string `protobuf:"bytes,4,opt,name=build_type,json=buildType,proto3" json:"buildType,omitempty"`
	// contains filtered or unexported fields
}

PluginMeta is metadata embedded in a plugin entrypoint.

func NewPluginMeta

func NewPluginMeta(projectID, pluginID, platformID, buildType string) *PluginMeta

NewPluginMeta constructs a new PluginMeta.

func UnmarshalPluginMetaB58

func UnmarshalPluginMetaB58(str string) (*PluginMeta, error)

UnmarshalPluginMetaB58 unmarshals a b58 meta. Note: we compress with s2 compression.

func (*PluginMeta) CloneMessageVT

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

func (*PluginMeta) CloneVT

func (m *PluginMeta) CloneVT() *PluginMeta

func (*PluginMeta) EqualMessageVT

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

func (*PluginMeta) EqualVT

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

func (*PluginMeta) GetBuildType

func (x *PluginMeta) GetBuildType() string

func (*PluginMeta) GetPlatformId

func (x *PluginMeta) GetPlatformId() string

func (*PluginMeta) GetPluginId

func (x *PluginMeta) GetPluginId() string

func (*PluginMeta) GetProjectId

func (x *PluginMeta) GetProjectId() string

func (*PluginMeta) MarshalB58

func (m *PluginMeta) MarshalB58() string

MarshalB58 marshals the conf to a b58 string. note: we compress with s2 compression & encrypt with a psk.

func (*PluginMeta) MarshalJSON

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

MarshalJSON marshals the PluginMeta to JSON.

func (*PluginMeta) MarshalProtoJSON

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

MarshalProtoJSON marshals the PluginMeta message to JSON.

func (*PluginMeta) MarshalProtoText

func (x *PluginMeta) MarshalProtoText() string

func (*PluginMeta) MarshalToSizedBufferVT

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

func (*PluginMeta) MarshalToVT

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

func (*PluginMeta) MarshalVT

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

func (*PluginMeta) ProtoMessage

func (*PluginMeta) ProtoMessage()

func (*PluginMeta) Reset

func (x *PluginMeta) Reset()

func (*PluginMeta) SizeVT

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

func (*PluginMeta) String

func (x *PluginMeta) String() string

func (*PluginMeta) UnmarshalJSON

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

UnmarshalJSON unmarshals the PluginMeta from JSON.

func (*PluginMeta) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the PluginMeta message from JSON.

func (*PluginMeta) UnmarshalVT

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

func (*PluginMeta) Validate

func (m *PluginMeta) Validate() error

Validate checks the plugin meta.

type PluginServer

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

PluginServer implements the plugin rpc server.

func NewPluginServer

func NewPluginServer(b bus.Bus) *PluginServer

NewPluginServer constructs the plugin rpc server.

func (*PluginServer) PluginRpc

func (s *PluginServer) PluginRpc(rpcStream SRPCPlugin_PluginRpcStream) error

PluginRpc handles an RPC call from a remote plugin. Component ID: remote plugin id Invokes the rpc on the bus with the server id set to plugin/remote plugin id.

type PluginStartInfo

type PluginStartInfo struct {

	// InstanceId is the plugin instance id.
	InstanceId string `protobuf:"bytes,1,opt,name=instance_id,json=instanceId,proto3" json:"instanceId,omitempty"`
	// PluginId is the plugin identifier.
	// Must be a valid-dns-label.
	PluginId string `protobuf:"bytes,2,opt,name=plugin_id,json=pluginId,proto3" json:"pluginId,omitempty"`
	// InstanceKey is the instance key from the LoadPlugin request.
	// Empty for non-instanced (shared) plugins.
	InstanceKey string `protobuf:"bytes,3,opt,name=instance_key,json=instanceKey,proto3" json:"instanceKey,omitempty"`
	// contains filtered or unexported fields
}

PluginStartInfo are details passed to the plugin by the plugin host in the environment.

func NewPluginStartInfo

func NewPluginStartInfo(instanceID, pluginID, instanceKey string) *PluginStartInfo

NewPluginStartInfo constructs a new PluginStartInfo.

func UnmarshalPluginStartInfoJsonBase64

func UnmarshalPluginStartInfoJsonBase64(data string) (*PluginStartInfo, error)

UnmarshalPluginStartInfoJsonBase64 unmarshals a base64-encoded JSON string into a PluginStartInfo.

func (*PluginStartInfo) CloneMessageVT

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

func (*PluginStartInfo) CloneVT

func (m *PluginStartInfo) CloneVT() *PluginStartInfo

func (*PluginStartInfo) EqualMessageVT

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

func (*PluginStartInfo) EqualVT

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

func (*PluginStartInfo) GetInstanceId

func (x *PluginStartInfo) GetInstanceId() string

func (*PluginStartInfo) GetInstanceKey

func (x *PluginStartInfo) GetInstanceKey() string

func (*PluginStartInfo) GetPluginId

func (x *PluginStartInfo) GetPluginId() string

func (*PluginStartInfo) MarshalJSON

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

MarshalJSON marshals the PluginStartInfo to JSON.

func (*PluginStartInfo) MarshalJsonBase64

func (m *PluginStartInfo) MarshalJsonBase64() (string, error)

MarshalJsonBase64 marshals the start info to base64-encoded json.

func (*PluginStartInfo) MarshalProtoJSON

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

MarshalProtoJSON marshals the PluginStartInfo message to JSON.

func (*PluginStartInfo) MarshalProtoText

func (x *PluginStartInfo) MarshalProtoText() string

func (*PluginStartInfo) MarshalToSizedBufferVT

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

func (*PluginStartInfo) MarshalToVT

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

func (*PluginStartInfo) MarshalVT

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

func (*PluginStartInfo) ProtoMessage

func (*PluginStartInfo) ProtoMessage()

func (*PluginStartInfo) Reset

func (x *PluginStartInfo) Reset()

func (*PluginStartInfo) SizeVT

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

func (*PluginStartInfo) String

func (x *PluginStartInfo) String() string

func (*PluginStartInfo) UnmarshalJSON

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

UnmarshalJSON unmarshals the PluginStartInfo from JSON.

func (*PluginStartInfo) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the PluginStartInfo message from JSON.

func (*PluginStartInfo) UnmarshalVT

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

func (*PluginStartInfo) Validate

func (m *PluginStartInfo) Validate() error

Validate checks the plugin meta.

type PluginState added in v0.51.0

type PluginState int32

PluginState is the scheduler state for a plugin instance.

const (
	// PluginState_UNKNOWN indicates the scheduler has no state yet.
	PluginState_PluginState_UNKNOWN PluginState = 0
	// PluginState_REQUESTED indicates the plugin has an active reference but no RPC client yet.
	PluginState_PluginState_REQUESTED PluginState = 1
	// PluginState_RUNNING indicates the plugin RPC client is ready.
	PluginState_PluginState_RUNNING PluginState = 2
)

func (PluginState) Enum added in v0.51.0

func (x PluginState) Enum() *PluginState

func (PluginState) MarshalJSON added in v0.51.0

func (x PluginState) MarshalJSON() ([]byte, error)

MarshalJSON marshals the PluginState to JSON.

func (PluginState) MarshalProtoJSON added in v0.51.0

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

MarshalProtoJSON marshals the PluginState to JSON.

func (PluginState) MarshalProtoText added in v0.51.0

func (x PluginState) MarshalProtoText() string

func (PluginState) MarshalText added in v0.51.0

func (x PluginState) MarshalText() ([]byte, error)

MarshalText marshals the PluginState to text.

func (PluginState) String added in v0.51.0

func (x PluginState) String() string

func (*PluginState) UnmarshalJSON added in v0.51.0

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

UnmarshalJSON unmarshals the PluginState from JSON.

func (*PluginState) UnmarshalProtoJSON added in v0.51.0

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

UnmarshalProtoJSON unmarshals the PluginState from JSON.

func (*PluginState) UnmarshalText added in v0.51.0

func (x *PluginState) UnmarshalText(b []byte) error

UnmarshalText unmarshals the PluginState from text.

type PluginStatus

type PluginStatus struct {

	// PluginId is the plugin identifier.
	PluginId string `protobuf:"bytes,1,opt,name=plugin_id,json=pluginId,proto3" json:"pluginId,omitempty"`
	// Running indicates the plugin is running.
	Running bool `protobuf:"varint,2,opt,name=running,proto3" json:"running,omitempty"`
	// InstanceKey is the optional instance key for instanced plugins.
	InstanceKey string `protobuf:"bytes,3,opt,name=instance_key,json=instanceKey,proto3" json:"instanceKey,omitempty"`
	// State is the scheduler state for this plugin instance.
	State PluginState `protobuf:"varint,4,opt,name=state,proto3" json:"state,omitempty"`
	// LastErrorMessage is the most recent plugin execution error summary.
	LastErrorMessage string `protobuf:"bytes,5,opt,name=last_error_message,json=lastErrorMessage,proto3" json:"lastErrorMessage,omitempty"`
	// LastErrorAt is when LastErrorMessage was recorded.
	LastErrorAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=last_error_at,json=lastErrorAt,proto3" json:"lastErrorAt,omitempty"`
	// contains filtered or unexported fields
}

PluginStatus holds basic status for a plugin.

func (*PluginStatus) CloneMessageVT

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

func (*PluginStatus) CloneVT

func (m *PluginStatus) CloneVT() *PluginStatus

func (*PluginStatus) EqualMessageVT

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

func (*PluginStatus) EqualVT

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

func (*PluginStatus) GetInstanceKey added in v0.51.0

func (x *PluginStatus) GetInstanceKey() string

func (*PluginStatus) GetLastErrorAt added in v0.51.3

func (x *PluginStatus) GetLastErrorAt() *timestamppb.Timestamp

func (*PluginStatus) GetLastErrorMessage added in v0.51.3

func (x *PluginStatus) GetLastErrorMessage() string

func (*PluginStatus) GetPluginId

func (x *PluginStatus) GetPluginId() string

func (*PluginStatus) GetRunning

func (x *PluginStatus) GetRunning() bool

func (*PluginStatus) GetState added in v0.51.0

func (x *PluginStatus) GetState() PluginState

func (*PluginStatus) MarshalJSON

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

MarshalJSON marshals the PluginStatus to JSON.

func (*PluginStatus) MarshalProtoJSON

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

MarshalProtoJSON marshals the PluginStatus message to JSON.

func (*PluginStatus) MarshalProtoText

func (x *PluginStatus) MarshalProtoText() string

func (*PluginStatus) MarshalToSizedBufferVT

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

func (*PluginStatus) MarshalToVT

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

func (*PluginStatus) MarshalVT

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

func (*PluginStatus) ProtoMessage

func (*PluginStatus) ProtoMessage()

func (*PluginStatus) Reset

func (x *PluginStatus) Reset()

func (*PluginStatus) SizeVT

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

func (*PluginStatus) String

func (x *PluginStatus) String() string

func (*PluginStatus) UnmarshalJSON

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

UnmarshalJSON unmarshals the PluginStatus from JSON.

func (*PluginStatus) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the PluginStatus message from JSON.

func (*PluginStatus) UnmarshalVT

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

func (*PluginStatus) Validate

func (s *PluginStatus) Validate() error

Validate validates the PluginStatus object.

type RunningPlugin

type RunningPlugin interface {
	// GetRpcClient returns the RPC client.
	GetRpcClient() srpc.Client
}

RunningPlugin is the interface exposed to callers of LoadPlugin.

func NewRunningPlugin

func NewRunningPlugin(client srpc.Client) RunningPlugin

NewRunningPlugin constructs a RunningPlugin with a static client.

type RunningPluginRef

type RunningPluginRef interface {
	// GetRunningPluginCtr returns the current running plugin instance.
	// May be changed (or set to nil) when the instance changes.
	GetRunningPluginCtr() ccontainer.Watchable[RunningPlugin]
}

RunningPluginRef is a reference to a running plugin.

type SRPCPluginClient

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

	// PluginRpc handles an RPC call from a remote plugin.
	// Component ID: remote plugin id
	PluginRpc(ctx context.Context) (SRPCPlugin_PluginRpcClient, error)
}

func NewSRPCPluginClient

func NewSRPCPluginClient(cc srpc.Client) SRPCPluginClient

func NewSRPCPluginClientWithServiceID

func NewSRPCPluginClientWithServiceID(cc srpc.Client, serviceID string) SRPCPluginClient

type SRPCPluginHandler

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

func (SRPCPluginHandler) GetMethodIDs

func (SRPCPluginHandler) GetMethodIDs() []string

func (*SRPCPluginHandler) GetServiceID

func (d *SRPCPluginHandler) GetServiceID() string

func (*SRPCPluginHandler) InvokeMethod

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

func (SRPCPluginHandler) InvokeMethod_PluginRpc

func (SRPCPluginHandler) InvokeMethod_PluginRpc(impl SRPCPluginServer, strm srpc.Stream) error

type SRPCPluginHostClient

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

	// GetPluginInfo returns the information for the current plugin.
	GetPluginInfo(ctx context.Context, in *GetPluginInfoRequest) (*GetPluginInfoResponse, error)
	// ExecController executes a controller configuration on the bus.
	ExecController(ctx context.Context, in *controller_exec.ExecControllerRequest) (SRPCPluginHost_ExecControllerClient, error)
	// LoadPlugin requests to load the plugin with the given ID.
	// The plugin will remain loaded as long as the RPC is active.
	// Multiple requests to load the same plugin are de-duplicated.
	LoadPlugin(ctx context.Context, in *LoadPluginRequest) (SRPCPluginHost_LoadPluginClient, error)
	// PluginRpc forwards an RPC call to a remote plugin.
	// The plugin will remain loaded as long as the RPC is active.
	// Component ID: plugin id, or plugin id / instance key for instanced plugins.
	PluginRpc(ctx context.Context) (SRPCPluginHost_PluginRpcClient, error)
	// PluginFsRpc accesses a FSCursorService to access plugin assets or dist filesystems.
	// The plugin will remain loaded as long as the RPC is active.
	// Component ID: plugin-assets or plugin-dist for current plugin
	// Component ID: plugin-assets/{plugin-id} or plugin-dist/{plugin-id} for remote plugin
	PluginFsRpc(ctx context.Context) (SRPCPluginHost_PluginFsRpcClient, error)
}

func NewSRPCPluginHostClient

func NewSRPCPluginHostClient(cc srpc.Client) SRPCPluginHostClient

func NewSRPCPluginHostClientWithServiceID

func NewSRPCPluginHostClientWithServiceID(cc srpc.Client, serviceID string) SRPCPluginHostClient

type SRPCPluginHostHandler

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

func (SRPCPluginHostHandler) GetMethodIDs

func (SRPCPluginHostHandler) GetMethodIDs() []string

func (*SRPCPluginHostHandler) GetServiceID

func (d *SRPCPluginHostHandler) GetServiceID() string

func (*SRPCPluginHostHandler) InvokeMethod

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

func (SRPCPluginHostHandler) InvokeMethod_ExecController

func (SRPCPluginHostHandler) InvokeMethod_ExecController(impl SRPCPluginHostServer, strm srpc.Stream) error

func (SRPCPluginHostHandler) InvokeMethod_GetPluginInfo

func (SRPCPluginHostHandler) InvokeMethod_GetPluginInfo(impl SRPCPluginHostServer, strm srpc.Stream) error

func (SRPCPluginHostHandler) InvokeMethod_LoadPlugin

func (SRPCPluginHostHandler) InvokeMethod_LoadPlugin(impl SRPCPluginHostServer, strm srpc.Stream) error

func (SRPCPluginHostHandler) InvokeMethod_PluginFsRpc

func (SRPCPluginHostHandler) InvokeMethod_PluginFsRpc(impl SRPCPluginHostServer, strm srpc.Stream) error

func (SRPCPluginHostHandler) InvokeMethod_PluginRpc

func (SRPCPluginHostHandler) InvokeMethod_PluginRpc(impl SRPCPluginHostServer, strm srpc.Stream) error

type SRPCPluginHostServer

type SRPCPluginHostServer interface {
	// GetPluginInfo returns the information for the current plugin.
	GetPluginInfo(context.Context, *GetPluginInfoRequest) (*GetPluginInfoResponse, error)
	// ExecController executes a controller configuration on the bus.
	ExecController(*controller_exec.ExecControllerRequest, SRPCPluginHost_ExecControllerStream) error
	// LoadPlugin requests to load the plugin with the given ID.
	// The plugin will remain loaded as long as the RPC is active.
	// Multiple requests to load the same plugin are de-duplicated.
	LoadPlugin(*LoadPluginRequest, SRPCPluginHost_LoadPluginStream) error
	// PluginRpc forwards an RPC call to a remote plugin.
	// The plugin will remain loaded as long as the RPC is active.
	// Component ID: plugin id, or plugin id / instance key for instanced plugins.
	PluginRpc(SRPCPluginHost_PluginRpcStream) error
	// PluginFsRpc accesses a FSCursorService to access plugin assets or dist filesystems.
	// The plugin will remain loaded as long as the RPC is active.
	// Component ID: plugin-assets or plugin-dist for current plugin
	// Component ID: plugin-assets/{plugin-id} or plugin-dist/{plugin-id} for remote plugin
	PluginFsRpc(SRPCPluginHost_PluginFsRpcStream) error
}

type SRPCPluginHost_ExecControllerClient

type SRPCPluginHost_ExecControllerClient interface {
	srpc.Stream
	Recv() (*controller_exec.ExecControllerResponse, error)
	RecvTo(*controller_exec.ExecControllerResponse) error
}

type SRPCPluginHost_ExecControllerStream

type SRPCPluginHost_ExecControllerStream interface {
	srpc.Stream
	Send(*controller_exec.ExecControllerResponse) error
	SendAndClose(*controller_exec.ExecControllerResponse) error
}

type SRPCPluginHost_GetPluginInfoStream

type SRPCPluginHost_GetPluginInfoStream interface {
	srpc.Stream
}

type SRPCPluginHost_LoadPluginClient

type SRPCPluginHost_LoadPluginClient interface {
	srpc.Stream
	Recv() (*LoadPluginResponse, error)
	RecvTo(*LoadPluginResponse) error
}

type SRPCPluginHost_LoadPluginStream

type SRPCPluginHost_LoadPluginStream interface {
	srpc.Stream
	Send(*LoadPluginResponse) error
	SendAndClose(*LoadPluginResponse) error
}

type SRPCPluginHost_PluginFsRpcClient

type SRPCPluginHost_PluginFsRpcClient interface {
	srpc.Stream
	Send(*rpcstream.RpcStreamPacket) error
	Recv() (*rpcstream.RpcStreamPacket, error)
	RecvTo(*rpcstream.RpcStreamPacket) error
}

type SRPCPluginHost_PluginFsRpcStream

type SRPCPluginHost_PluginFsRpcStream interface {
	srpc.Stream
	Send(*rpcstream.RpcStreamPacket) error
	SendAndClose(*rpcstream.RpcStreamPacket) error
	Recv() (*rpcstream.RpcStreamPacket, error)
	RecvTo(*rpcstream.RpcStreamPacket) error
}

type SRPCPluginHost_PluginRpcClient

type SRPCPluginHost_PluginRpcClient interface {
	srpc.Stream
	Send(*rpcstream.RpcStreamPacket) error
	Recv() (*rpcstream.RpcStreamPacket, error)
	RecvTo(*rpcstream.RpcStreamPacket) error
}

type SRPCPluginHost_PluginRpcStream

type SRPCPluginHost_PluginRpcStream interface {
	srpc.Stream
	Send(*rpcstream.RpcStreamPacket) error
	SendAndClose(*rpcstream.RpcStreamPacket) error
	Recv() (*rpcstream.RpcStreamPacket, error)
	RecvTo(*rpcstream.RpcStreamPacket) error
}

type SRPCPluginServer

type SRPCPluginServer interface {
	// PluginRpc handles an RPC call from a remote plugin.
	// Component ID: remote plugin id
	PluginRpc(SRPCPlugin_PluginRpcStream) error
}

type SRPCPlugin_PluginRpcClient

type SRPCPlugin_PluginRpcClient interface {
	srpc.Stream
	Send(*rpcstream.RpcStreamPacket) error
	Recv() (*rpcstream.RpcStreamPacket, error)
	RecvTo(*rpcstream.RpcStreamPacket) error
}

type SRPCPlugin_PluginRpcStream

type SRPCPlugin_PluginRpcStream interface {
	srpc.Stream
	Send(*rpcstream.RpcStreamPacket) error
	SendAndClose(*rpcstream.RpcStreamPacket) error
	Recv() (*rpcstream.RpcStreamPacket, error)
	RecvTo(*rpcstream.RpcStreamPacket) error
}

Directories

Path Synopsis
assets
go
go/dev-wrapper command
js
logs
Package plugin_host_logs contains structured plugin log schema types.
Package plugin_host_logs contains structured plugin log schema types.
web
ast

Jump to

Keyboard shortcuts

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