Documentation ¶
Overview ¶
Package deployer provides interfaces for all deployers of plugins to follow.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnyConnectorFactory ¶
type AnyConnectorFactory interface { Name() string ConfigurationSchema() schema.Object Create(config any, logger log.Logger) (Connector, error) DeploymentType() DeploymentType }
AnyConnectorFactory is the untyped version of ConnectorFactory.
func Any ¶
func Any[T any](factory ConnectorFactory[T]) AnyConnectorFactory
Any wraps a factory and creates an anonymous factory from it.
type Connector ¶
type Connector interface { // Deploy instructs the connector to aquire the plugin and run it, // resulting in the plugin starting its ATP server. // The ATP server will be accessible through the `Plugin` interface. // // Parameters: // ctx: The context that lasts the length of the deployment. // A cancelled context means the plugin is in the process of getting shut down, or is shut down. No new // deployment should be allowed. // pluginSource: The source of the plugin. This can be the tag of the image to run, a Python module, or // anything else that the deployer supports. Deploy(ctx context.Context, pluginSource string) (Plugin, error) }
Connector is responsible for deploying a container image on the specified target. Once deployed and ready, the connector returns an I/O to communicate with the plugin.
type ConnectorFactory ¶
type ConnectorFactory[ConfigType any] interface { Name() string ConfigurationSchema() *schema.TypedScopeSchema[ConfigType] Create(config ConfigType, logger log.Logger) (Connector, error) DeploymentType() DeploymentType }
ConnectorFactory is an abstraction that hides away the complexity of instantiating a Connector. Its main purpose is to provide the configuration schema for the connector and then create an instance of said connector.
type DeploymentType ¶ added in v0.4.0
type DeploymentType string
DeploymentType is the mechanism of deployment, such as image or python.
type Plugin ¶
Plugin is single, possibly containerized instance of a plugin. When read from, this interface provides the stdout of the plugin, supposedly talking the Arcaflow Transport Protocol, whereas the writer will write to the standard input of the plugin. The Close() method will shut the plugin down and return when the shutdown was successful.