Initial C# SDK structure and interfaces

This commit is contained in:
2026-04-06 23:33:56 +02:00
commit 015109f763
5 changed files with 58 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
.vs/
[Bb]in/
[Oo]bj/
*.user
*.suo

7
Chtn.CSharp.SDK.csproj Normal file
View File

@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
</Project>

26
Core/ChateniumClient.cs Normal file
View File

@@ -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");
}
}
}

View File

@@ -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();
}
}

10
Interfaces/IKeyringAPI.cs Normal file
View File

@@ -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();
}
}