.NET library for building DStream-compatible plugins using gRPC and the HashiCorp go‑plugin protocol.
Enable seamless integration of C# plugin components with the DStream CLI, leveraging the same Terraform-style plugin framework used by HashiCorp tools.
- .NET 9.0 SDK or later
- DStream CLI (Go) installed and available on your PATH
plugin.proto
definitions (included in this package)
dotnet add package Katasec.DStream.Plugin
using static Katasec.DStream.Plugin.Plugin;
using Google.Protobuf.WellKnownTypes;
using Grpc.Core;
public class MyPlugin : PluginBase, IDStreamPlugin
{
public override Task<GetSchemaResponse> GetSchema(Empty request, ServerCallContext context)
{
// Your implementation here
}
// Implement other RPC methods...
}
var host = new DStreamPluginHost<MyPlugin>("my-plugin-id", new MyPlugin());
host.Run(); // Or host.RunAsync(CancellationToken)
Check the Examples/
folder for a fully working example.
src/
Katasec.DStream.Plugin/ ← Main library
Protos/ ← Contains plugin.proto
tests/
Katasec.DStream.Plugin.Tests/ ← Unit & integration tests
- Generated gRPC code lives in
Katasec.DStream.Plugin.Protos
- Core types:
IDStreamPlugin
,DStreamPluginHost
,HashiCorpPluginUtils
, along with gRPC service classes
- Protocol defined in
protos/plugin.proto
- Generated types available in
Katasec.DStream.Plugin.Protos
- Implements key RPCs:
GetSchema
,WriteRows
,Stop
,HealthCheck
- Package includes XML documentation for IntelliSense support
This README follows Microsoft’s NuGet recommendations, including:
- Clear purpose and summary
- Quick‑start code examples
- Project layout overview
To embed this README in your NuGet package, add to your .csproj
:
<PropertyGroup>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="" />
</ItemGroup>
git clone https://github.com/katasec/Katasec.DStream.Plugin.git
cd Katasec.DStream.Plugin
dotnet build
dotnet test
Contributions, issues, and feature requests are welcome!
Follow the standard workflow:
- Fork the repo
- Create a feature branch (
git checkout -b feature/foo
) - Commit changes (
git commit -am 'Add foo feature'
) - Push to your branch (
git push origin feature/foo
) - Open a pull request
Refer to CONTRIBUTING.md for details.
- License: MIT
- Support: Open issues or PRs via GitHub
Thanks to the creators of the HashiCorp go‑plugin protocol and the DStream CLI for inspiring this library.
(This README is included in the NuGet package per Microsoft’s best practices.)