plugins

package
v2.135.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadPluginsTasks

func LoadPluginsTasks(pluginsParam godellauncher.PluginsParam, stdout io.Writer) ([]godellauncher.Task, []godellauncher.UpgradeConfigTask, error)

LoadPluginsTasks returns the tasks defined by the plugins in the specified parameters. Does the following:

  • Resolves the plugins defined in the provided params for the runtime environment's OS/Architecture into the gödel home plugins and downloads directories.
  • Verifies that the resolved plugins are valid and compatible with each other (for example, ensures that multiple plugins do not provide the same task).
  • Creates runnable godellauncher.Task tasks for the plugins.

Returns the tasks provided by the plugins in the provided parameters.

func LoadPluginsTasksWithCache added in v2.128.0

func LoadPluginsTasksWithCache(pluginsConfig config.PluginsConfig, pluginsParam godellauncher.PluginsParam, stdout io.Writer) ([]godellauncher.Task, []godellauncher.UpgradeConfigTask, error)

LoadPluginsTasksWithCache loads the plugin tasks and upgrade tasks for the provided plugins config. This function is the equivalent of LoadPluginsTasks but uses a cache file to retrieve and store the plugin information.

Using a cache is motivated by the fact that the "LoadPluginsTasks" function can be relatively expensive to call because the "resolvePlugins" function potentially computes the checksum of all plugins and assets (which requires reading and computing a checksum of all plugin and asset files) and also invokes all the plugin binaries to parse their information. For a godel installation with a representative number of plugins and assets, this operation can take around 250ms. Although this may not be a long time on an absolute scale, it is long enough to feel like a pause to the user when invoking the CLI, and this cost is incurred on every invocation of the CLI. The godel configuration for a given project is also relatively stable (the number and frequency of changes to the configuration is orders of magnitude less than the number of times the CLI is invoked), so there will also typically be many more cache hits than misses, which makes this ideal information to cache.

The cache file is determined by the SHA256 checksum of the JSON representation of the plugins config. The provided PluginsParam should be the result of calling "ToParam()" on the provided PluginsConfig. Note that the name of the cache file is based on the checksum of the plugins configuration, but its content is the JSON representation of the plugins map used to compute the result of this function (so the checksum of the content will not match the name of the file).

The current design keys the cache content only on the plugins configuration. This means, that if the logic of godel itself changes in a manner such that a given plugin configuration would produce different plugin information, the cached information would not be correct. In such a scenario, the naming scheme for the cache files would need to be updated to ensure that invalid cache information is not used. Namespacing the cache files by the version of godel would be one way of protecting against this, but given that the logic for computing the plugin information is very stable (it has not changed in over 9 years), it is unlikely to be an issue (and in such a circumstance, changing the naming scheme of the cache to add some kind of schema prefix or suffix or as a parent directory should be a sufficient solution).

func LoadProvidedConfigurations

func LoadProvidedConfigurations(taskConfigProvidersParam godellauncher.TasksConfigProvidersParam, stdout io.Writer) ([]config.TasksConfig, error)

LoadProvidedConfigurations returns all of the godellauncher.GodelConfig configurations provided by the specified params. Does the following:

  • Resolves all of the configuration providers defined in the provided params into the gödel home configs and downloads directories.
  • Unmarshals all of the resolved configurations into godellauncher.TasksConfig structs.

Returns all of the unmarshaled configurations.

Types

This section is empty.

Jump to

Keyboard shortcuts

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