Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support per-plugin configuration #55

Merged
merged 4 commits into from
Dec 2, 2024
Merged

Support per-plugin configuration #55

merged 4 commits into from
Dec 2, 2024

Conversation

markgoddard
Copy link
Contributor

@markgoddard markgoddard commented Nov 29, 2024

  • Export command context package
    It is useful for CLI plugins.

  • Move default CommandContext setup to NewCommandContext
    This allows plugins to create a CommandContext without exporting the
    config package.

  • Support per-plugin configuration
    For some plugins it would be useful to be able to store configuration
    options in cofide.yaml. This change updates the plugin manager to
    support setting and retrieving per-plugin configuration keyed by the
    plugin name. The config can be set during Init or later using
    GetPluginConfig.

    A Struct protobuf message is used to allow for arbitrarily structured
    plugin config. Plugins can use the Struct directly or convert it to/from
    a more convenient native Go type.

Fixes: #54
Depends-On: cofide/cofide-api-sdk#8

It is useful for CLI plugins.
This allows plugins to create a CommandContext without exporting the
config package.
@markgoddard markgoddard self-assigned this Nov 29, 2024
@markgoddard markgoddard added this to the release-0.7.0 milestone Nov 29, 2024
For some plugins it would be useful to be able to store configuration
options in cofide.yaml. This change updates the plugin manager to
support setting and retrieving per-plugin configuration keyed by the
plugin name. The config can be set during Init or later using
GetPluginConfig.

A Struct protobuf message is used to allow for arbitrarily structured
plugin config. Plugins can use the Struct directly or convert it to/from
a more convenient native Go type.

Fixes: #54

Depends-On: cofide/cofide-api-sdk#8
Copy link
Contributor

@jsnctl jsnctl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All LGTM and the tests also pass on my local run

@markgoddard markgoddard enabled auto-merge December 2, 2024 13:16
@markgoddard markgoddard merged commit c121671 into main Dec 2, 2024
5 checks passed
@markgoddard markgoddard deleted the issues/54 branch December 2, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support setting per-plugin configuration options in the config file
3 participants