commit 015109f763bcd29189c093d5a2e7cb1e64e42e15 Author: GoldenBIOS Date: Mon Apr 6 23:33:56 2026 +0200 Initial C# SDK structure and interfaces diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6a84733 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.vs/ +[Bb]in/ +[Oo]bj/ +*.user +*.suo \ No newline at end of file diff --git a/Chtn.CSharp.SDK.csproj b/Chtn.CSharp.SDK.csproj new file mode 100644 index 0000000..dbdcea4 --- /dev/null +++ b/Chtn.CSharp.SDK.csproj @@ -0,0 +1,7 @@ + + + + netstandard2.0 + + + diff --git a/Core/ChateniumClient.cs b/Core/ChateniumClient.cs new file mode 100644 index 0000000..0d60ea3 --- /dev/null +++ b/Core/ChateniumClient.cs @@ -0,0 +1,26 @@ +using Chtn.CSharpSDK.Interfaces; +using System.Net.Http; +using System; + +namespace Chtn.CSharpSDK.Core +{ + public class ChateniumClient + { + private readonly IKeyringAPI _keyring; + private readonly IDatabaseAPI _database; + private readonly HttpClient _httpClient; + + public ChateniumClient(IKeyringAPI keyring, IDatabaseAPI database) + { + _keyring = keyring ?? throw new ArgumentNullException(nameof(keyring)); + _database = database ?? throw new ArgumentNullException(nameof(database)); + + _httpClient = new HttpClient(); + _httpClient.BaseAddress = new Uri("https://api.chatenium.hu"); + } + public void initialize() + { + _keyring.Set("keyring", "anyad"); + } + } +} \ No newline at end of file diff --git a/Interfaces/IDatabaseAPI.cs b/Interfaces/IDatabaseAPI.cs new file mode 100644 index 0000000..3ecf96e --- /dev/null +++ b/Interfaces/IDatabaseAPI.cs @@ -0,0 +1,10 @@ +namespace Chtn.CSharpSDK.Interfaces +{ + public interface IDatabaseAPI + { + void Set(string collection, string key, object value); + string Get(string collection, string key); + void Delete(string collection, string key); + void Flush(); + } +} \ No newline at end of file diff --git a/Interfaces/IKeyringAPI.cs b/Interfaces/IKeyringAPI.cs new file mode 100644 index 0000000..782197a --- /dev/null +++ b/Interfaces/IKeyringAPI.cs @@ -0,0 +1,10 @@ +namespace Chtn.CSharpSDK.Interfaces +{ + public interface IKeyringAPI + { + void Set(string key, object value); + string Get(string key); + void Delete(string key); + void Flush(); + } +} \ No newline at end of file