shared

package
v0.0.0-...-27d56bb Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MPL-2.0 Imports: 6 Imported by: 0

README

protocol wrappers

Summary

This directory contains gRPC wrappers (written in Go) for FlexModule.

Description

Each subdirectory contains a Go gRPC wrapper library implemented for a specific backend. These libraries are used by both the runtime and modules to establish a common protocol for communication.

Adding Support for Other Languages

Currently, only Go is supported, as the Proof of Concept (PoC) implementation is not yet complete.

Of course, you can generate gRPC clients in your language of choice using the proto definitions located in /proto. By implementing wrappers for each backend (similar to those in the subdirectories), you can re-implement the FlexModule protocol in other languages. (Naturally, you can exclude functions used exclusively by the runtime.)

"I've created a FlexModule protocol wrapper in an unsupported language! Please merge it into the repository."

While we appreciate the contribution, the protocol is expected to undergo numerous changes and significant evolution in the future.

Therefore, we are not adding support for new languages at this time. We may be able to accept contributions after this project is merged into Chatanium v2 (which will take some time!).

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Handshake = plugin.HandshakeConfig{
	ProtocolVersion:  1,
	MagicCookieKey:   "FLEXMODULE_PLUGIN",
	MagicCookieValue: "CHATANIUM_FOREVER",
}

Handshake is a common handshake that is shared by plugin and host.

View Source
var ModulePluginMap = map[string]plugin.Plugin{
	"core-v1":    &core_module.Plugin{},
	"discord-v1": &discord_module.Plugin{},
}

ModulePluginMap is the map of plugins we can dispense.

View Source
var RuntimePluginMap = map[string]plugin.Plugin{
	"core-v1":    &core_runtime.Plugin{},
	"discord-v1": &discord_runtime.Plugin{},
}

ModulePluginMap is the map of plugins for the runtime. This map is used at runtime, so it's not needed in the module implementation.

Functions

func CreateRuntimePluginMap

func CreateRuntimePluginMap(discordHelper discord_shared.Helper, voiceHelper *discord_runtime.VoiceHelper) map[string]plugin.Plugin

CreateRuntimePluginMap creates a runtime plugin map with the given Discord helper and voice helper

func ServeToRuntime

func ServeToRuntime(plugins map[string]plugin.Plugin)

Types

This section is empty.

Directories

Path Synopsis
Package shared contains shared data between the host and plugins.
Package shared contains shared data between the host and plugins.

Jump to

Keyboard shortcuts

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