aboutsummaryrefslogtreecommitdiff
path: root/lib/Plugins/src
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2023-09-19 22:11:00 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2023-09-19 22:11:00 -0400
commit0b4e18b9a7d8e0aea23aef7efd3707674f223b2b (patch)
treea46aba32c4dee4e593267e34bc5f0830af7353ee /lib/Plugins/src
parentcdeda79bc7d358c617b05b17d24f3f3c79689379 (diff)
Experimental plugin runtime updates
Diffstat (limited to 'lib/Plugins/src')
-rw-r--r--lib/Plugins/src/IPlugin.cs15
-rw-r--r--lib/Plugins/src/VNLib.Plugins.csproj4
-rw-r--r--lib/Plugins/src/VfReturnType.cs61
-rw-r--r--lib/Plugins/src/Web/IEndpoint.cs (renamed from lib/Plugins/src/IEndpoint.cs)0
-rw-r--r--lib/Plugins/src/Web/IWebPlugin.cs (renamed from lib/Plugins/src/IVirtualEndpoint.cs)26
-rw-r--r--lib/Plugins/src/Web/WebMessage.cs (renamed from lib/Plugins/src/WebMessage.cs)0
6 files changed, 16 insertions, 90 deletions
diff --git a/lib/Plugins/src/IPlugin.cs b/lib/Plugins/src/IPlugin.cs
index d872232..c1fa6a6 100644
--- a/lib/Plugins/src/IPlugin.cs
+++ b/lib/Plugins/src/IPlugin.cs
@@ -22,9 +22,6 @@
* along with VNLib.Plugins. If not, see http://www.gnu.org/licenses/.
*/
-using System;
-using System.Collections.Generic;
-
namespace VNLib.Plugins
{
/// <summary>
@@ -36,23 +33,15 @@ namespace VNLib.Plugins
/// The name of the plugin to referrence (may be used by the host to interact)
/// </summary>
string PluginName { get; }
+
/// <summary>
/// Performs operations to prepare the plugin for use
/// </summary>
void Load();
+
/// <summary>
/// Invoked when the plugin is unloaded from the runtime
/// </summary>
void Unload();
- /// <summary>
- /// Returns all endpoints within the plugin to load into the current root
- /// </summary>
- /// <returns>An enumeration of endpoints to load</returns>
- /// <remarks>
- /// Lifecycle: Results returned from this method should be consistant (although its only
- /// likely to be called once) anytime after the <see cref="Load"/> method, and undefined
- /// after the <see cref="Unload"/> method is called.
- /// </remarks>
- IEnumerable<IEndpoint> GetEndpoints();
}
} \ No newline at end of file
diff --git a/lib/Plugins/src/VNLib.Plugins.csproj b/lib/Plugins/src/VNLib.Plugins.csproj
index 5b05caf..51cdc20 100644
--- a/lib/Plugins/src/VNLib.Plugins.csproj
+++ b/lib/Plugins/src/VNLib.Plugins.csproj
@@ -48,8 +48,4 @@
</None>
</ItemGroup>
- <ItemGroup>
- <Folder Include="Services\" />
- </ItemGroup>
-
</Project>
diff --git a/lib/Plugins/src/VfReturnType.cs b/lib/Plugins/src/VfReturnType.cs
deleted file mode 100644
index 8ebcb26..0000000
--- a/lib/Plugins/src/VfReturnType.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-* Copyright (c) 2022 Vaughn Nugent
-*
-* Library: VNLib
-* Package: VNLib.Plugins
-* File: Interfaces.cs
-*
-* Interfaces.cs is part of VNLib.Plugins which is part of the larger
-* VNLib collection of libraries and utilities.
-*
-* VNLib.Plugins is free software: you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published
-* by the Free Software Foundation, either version 2 of the License,
-* or (at your option) any later version.
-*
-* VNLib.Plugins is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with VNLib.Plugins. If not, see http://www.gnu.org/licenses/.
-*/
-
-namespace VNLib.Plugins
-{
-
- /// <summary>
- /// Represents the result of a virutal endpoint processing operation
- /// </summary>
- public enum VfReturnType
- {
- /// <summary>
- /// Signals that the virtual endpoint
- /// </summary>
- ProcessAsFile,
- /// <summary>
- /// Signals that the virtual endpoint generated a response, and
- /// the connection should be completed
- /// </summary>
- VirtualSkip,
- /// <summary>
- /// Signals that the virtual endpoint determined that the connection
- /// should be denied.
- /// </summary>
- Forbidden,
- /// <summary>
- /// Signals that the resource the virtual endpoint was processing
- /// does not exist.
- /// </summary>
- NotFound,
- /// <summary>
- /// Signals that the virutal endpoint determined the request was invalid
- /// </summary>
- BadRequest,
- /// <summary>
- /// Signals that the virtual endpoint had an error
- /// </summary>
- Error
- }
-}
diff --git a/lib/Plugins/src/IEndpoint.cs b/lib/Plugins/src/Web/IEndpoint.cs
index 33d49df..33d49df 100644
--- a/lib/Plugins/src/IEndpoint.cs
+++ b/lib/Plugins/src/Web/IEndpoint.cs
diff --git a/lib/Plugins/src/IVirtualEndpoint.cs b/lib/Plugins/src/Web/IWebPlugin.cs
index 5f33c0f..ed080d0 100644
--- a/lib/Plugins/src/IVirtualEndpoint.cs
+++ b/lib/Plugins/src/Web/IWebPlugin.cs
@@ -1,11 +1,11 @@
/*
-* Copyright (c) 2022 Vaughn Nugent
+* Copyright (c) 2023 Vaughn Nugent
*
* Library: VNLib
* Package: VNLib.Plugins
-* File: IVirtualEndpoint.cs
+* File: IWebPlugin.cs
*
-* IVirtualEndpoint.cs is part of VNLib.Plugins which is part of the larger
+* IWebPlugin.cs is part of VNLib.Plugins which is part of the larger
* VNLib collection of libraries and utilities.
*
* VNLib.Plugins is free software: you can redistribute it and/or modify
@@ -22,22 +22,24 @@
* along with VNLib.Plugins. If not, see http://www.gnu.org/licenses/.
*/
-using System.Threading.Tasks;
+using System.Collections.Generic;
namespace VNLib.Plugins
{
-
/// <summary>
- /// Represents a virtual page which provides processing on an entity
+ /// Represents a plugin that is expected to perform web application based operations
/// </summary>
- /// <typeparam name="TEntity">The entity type to process</typeparam>
- public interface IVirtualEndpoint<TEntity> : IEndpoint
+ public interface IWebPlugin : IPlugin
{
/// <summary>
- /// The handler method for processing the specified location.
+ /// Returns all endpoints within the plugin to load into the current root
/// </summary>
- /// <param name="entity">The current connection/session </param>
- /// <returns>A <see cref="VfReturnType"/> specifying how the caller should continue processing the request</returns>
- public ValueTask<VfReturnType> Process(TEntity entity);
+ /// <returns>An enumeration of endpoints to load</returns>
+ /// <remarks>
+ /// Lifecycle: Results returned from this method should be consistant (although its only
+ /// likely to be called once) anytime after the <see cref="IPlugin.Load"/> method, and undefined
+ /// after the <see cref="IPlugin.Unload"/> method is called.
+ /// </remarks>
+ IEnumerable<IEndpoint> GetEndpoints();
}
} \ No newline at end of file
diff --git a/lib/Plugins/src/WebMessage.cs b/lib/Plugins/src/Web/WebMessage.cs
index fb6ca6f..fb6ca6f 100644
--- a/lib/Plugins/src/WebMessage.cs
+++ b/lib/Plugins/src/Web/WebMessage.cs