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

feat(modules): plugins/modules architecture #14

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

DanielHe4rt
Copy link
Contributor

This pull request includes significant updates to the plugin architecture and documentation, focusing on the addition of a new plugin system and the implementation of a Rust-based plugin for OBS (Open Broadcaster Software). The most important changes include the addition of a new plugin skeleton, the creation of an OBS plugin, and updates to the documentation to reflect these changes.

Module/Plugin Configuration

Inside the ModuleAction you can find an Vec<ModuleSettings> property which will holds all information you need to
build the settings page inside the application. You can think into something which will holds any metadata needed to
perform the module action. E.g:

Module: OBS
Settings:
* Address: string (ipv4/ipv6)
* Port: int
* Password: Option<String> 

This will be stored together with the user profile and should be sent to every request arg as {module}_{settings}.

Imagine that we have two different modules being Twitch and OBS:

obs_host: something
obs_port: something

twitch_access_key: some-key 

you would be able to use these informations inside the module actions:

pub async fn toggle_stream(args: HashMap<String, String>) -> anyhow::Result<usize> {
    let host = args.get("obs_host").unwrap().clone();
    let port = args.get("obs_port").unwrap().clone().parse::<u16>().unwrap();
    let password = args.get("obs_password");

    let service = obws::Client::connect(host, port, password).await?;
    let service = service.streaming();

    let status = service.status().await?;

    match status.active {
        true => service.stop().await?,
        false => service.start().await?,
    }

    Ok(0)
}

Copy link
Contributor

@gvieira18 gvieira18 left a comment

Choose a reason for hiding this comment

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

The files rust-toolchain.toml, rustfmt.toml and Makefile are missing from the src-plugins folder. The changes to the CI files are also mentioned, but for these in particular you can ignore them and I'll update them later.

Run make check after adding the remaining files please.

@@ -0,0 +1,6 @@
[workspace]
Copy link
Contributor

Choose a reason for hiding this comment

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

Apparently the resolver directive is missing

warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions

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.

2 participants