diff options
author | vnugent <public@vaughnnugent.com> | 2023-06-16 13:33:43 -0400 |
---|---|---|
committer | vnugent <public@vaughnnugent.com> | 2023-06-16 13:33:43 -0400 |
commit | 44f25885437d6d09ea04cf74db4556df95821d56 (patch) | |
tree | b7876edf7b36f0c56ec9bcd947dcbcbb4a9b6a1f /lib/Plugins | |
parent | abbfe728fde9e0a5643b3c4e85d1cd27b15c59f4 (diff) |
Some tcp buf, minor bits and bobs
Diffstat (limited to 'lib/Plugins')
-rw-r--r-- | lib/Plugins/README.md | 81 |
1 files changed, 7 insertions, 74 deletions
diff --git a/lib/Plugins/README.md b/lib/Plugins/README.md index 1f08b6f..a4f4fc0 100644 --- a/lib/Plugins/README.md +++ b/lib/Plugins/README.md @@ -4,81 +4,14 @@ A compact and simple contract interface and supporting types for runtime loadabl **This library has no internal or external dependencies** -#### Builds -Debug build w/ symbols & xml docs, release builds, NuGet packages, and individually packaged source code are available on my [website](https://www.vaughnnugent.com/resources/software). All tar-gzip (.tgz) files will have an associated .sha384 appended checksum of the desired download file. +### Builds +Debug build w/ symbols & xml docs, release builds, NuGet packages, and individually packaged source code are available on my website (link below). All tar-gzip (.tgz) files will have an associated .sha384 appended checksum of the desired download file. -### Usage with VNLib.Plugins.Essentials. +### Docs and Guides +Documentation, specifications, and setup guides are available on my website. -The **VNLib.Plugins.Essentials** library discovers IEndpoint types at runtime inside `EventProcessor` types. For correct usage with the `EventProcessor` class you should implement the interface `IVirtualEndpoint<HttpEntity>` otherwise your endpoint will not get loaded. +[Docs and Articles](https://www.vaughnnugent.com/resources/software/articles?tags=docs,_VNLib.Plugins) +[Builds and Source](https://www.vaughnnugent.com/resources/software/modules/VNLib.Core) -All plugins that intend to be loaded with the **VNLib.Plugins.Essentials.ServiceStack** application library, should conform to these signatures. The ServiceStack library also implements the additional lifecycle hooks if you choose to implement them. - -## Breakdown - -The `IPlugin` interface: a simple contract -``` programming language C# - //Should be public and concrete for runtime loading - public sealed class MyPlugin : IPluign - { - private readonly LinkedList<IEndpoint> _endpoints; - - public MyPlugin() - { - _endpoints = new LinkedList<IEndpoint>(); - } - - public string PluginName { get; } = "MyPlugin"; - - public void Load() - { - //Load plugin, build endpoints - IEndpoint ep1 = new MyEndpoint(); - IEndpoint ep2 = new MyEndpoint(); - //Add endpoints - _endpoints.AddLast(ep1); - _endpoints.AddLast(ep2); - } - - public void Unload() - { - //Unload resources - } - - public IEnumerable<IEndpoint> GetEndpoints() - { - //Return the endpoints for this plugin - return _endpoints; - } - - ... Additional lifecycle methods using the Attributes namespace - } -``` - -The `IEndpoint` interface: represents a resource location in a url search path -``` programming language C# - //Should be public and concrete - internal class MyEndpoint : IEndpoint - { - public string Path { get; } = "/my/resource"; - } -``` - -A step farther is the `IVirtualEndpoint<TEntity>` which processes an entity of the specified type, and implements the IEndpoint interface: -_This interface was built for usage with the `IHttpEvent` interface as the entity type._ -``` - //Should be public and concrete - internal class MyVirtualEndpoint : IVirtualEndpoint<IHttpEvent> - { - public string Path { get; } = "/my/resource"; - - //process HTTP connection - public ValutTask<VfReturnType> Process(IHttpEvent entity) - { - //Process the entity - return VfReturnType.ProcessAsFile; - } - } -``` ## License -The software in this repository is licensed under the GNU GPL version 2.0 (or any later version). -See the LICENSE files for more information.
\ No newline at end of file +The software in this repository is licensed under the GNU GPL version 2.0 (or any later version). See the LICENSE files for more information.
\ No newline at end of file |