mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-07 12:16:04 +00:00
25 lines
1010 B
C#
25 lines
1010 B
C#
using System.Net;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace WelsonJS.Launcher
|
|
{
|
|
/// <summary>
|
|
/// Defines a contract for resource tools that can handle specific HTTP requests.
|
|
/// </summary>
|
|
public interface IResourceTool
|
|
{
|
|
/// <summary>
|
|
/// Determines whether this tool can handle the specified path.
|
|
/// </summary>
|
|
/// <param name="path">The request path to check.</param>
|
|
/// <returns>True if this tool can handle the request; otherwise, false.</returns>
|
|
bool CanHandle(string path);
|
|
/// <summary>
|
|
/// Asynchronously processes the HTTP request for the specified path.
|
|
/// </summary>
|
|
/// <param name="context">The HTTP listener context containing request and response objects.</param>
|
|
/// <param name="path">The request path to handle.</param>
|
|
/// <returns>A task representing the asynchronous operation.</returns>
|
|
Task HandleAsync(HttpListenerContext context, string path);
|
|
}
|
|
} |