Luski.Net/Luski.net/Interfaces/IServer.cs

38 lines
1.6 KiB
C#
Raw Normal View History

using System.Collections.Generic;
using System.Net.Http;
using System.Text.Json.Serialization.Metadata;
using System.Threading;
using System.Threading.Tasks;
using Luski.net.JsonTypes.BaseTypes;
using Luski.net.Structures;
using Luski.net.Structures.Public;
2024-03-20 23:18:34 -04:00
using Luski.Shared.PublicServers.V1.ServerToClient.HTTP;
namespace Luski.net.Interfaces;
public interface IServer
{
public IAppUser IAppUser { get; }
public string Cache { get; }
public void SendServer<Tvalue>(Tvalue Payload, JsonTypeInfo<Tvalue> jsonTypeInfo) where Tvalue : IncomingWSS;
public HttpResponseMessage GetFromServer(string Path, CancellationToken CancellationToken,
params KeyValuePair<string, string?>[] Headers);
public Task GetFromServer(string Path, string File, CancellationToken CancellationToken,
params KeyValuePair<string, string?>[] Headers);
public Task<Tresult> GetFromServer<Tresult>(string Path, JsonTypeInfo<Tresult> Type,
CancellationToken CancellationToken, params KeyValuePair<string, string?>[] Headers)
2024-03-20 23:18:34 -04:00
where Tresult : STC, new();
public Task<Tresult> SendServer<Tvalue, Tresult>(string Path, Tvalue Payload,
JsonTypeInfo<Tvalue> jsonTypeInfo, JsonTypeInfo<Tresult> ReturnjsonTypeInfo,
CancellationToken CancellationToken, params KeyValuePair<string, string?>[] Headers)
2024-03-20 23:18:34 -04:00
where Tvalue : IWebRequest where Tresult : STC, new();
public Task<Tresult> SendServer<Tresult>(string Path, string File, JsonTypeInfo<Tresult> ReturnjsonTypeInfo,
CancellationToken CancellationToken, params KeyValuePair<string, string?>[] Headers)
2024-03-20 23:18:34 -04:00
where Tresult : STC, new();
}