Skip to content

Commit

Permalink
Refactor project folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Jandini committed Oct 16, 2023
1 parent 745c75f commit 5c16747
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Text.Json.Serialization;

namespace KiBoards.Services
namespace KiBoards.Models.Settings
{
class KibanaSettingsChanges
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace KiBoards.Services
{
namespace KiBoards.Models.Settings
{
class KibanaSettingsRequest
{
public KibanaSettingsChanges Changes { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace KiBoards.Services
namespace KiBoards.Models.Status
{
class KibanaStatus
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace KiBoards.Services
namespace KiBoards.Models.Status
{
class KibanaStatusOverall
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace KiBoards.Services
namespace KiBoards.Models.Status
{
class KibanaStatusResponse
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace KiBoards.Services
namespace KiBoards.Models.Status
{
class KibanaVersion
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
using System.Net.Http.Json;
using KiBoards.Models.Settings;
using KiBoards.Models.Status;

namespace KiBoards.Services
{
internal class KibanaClient
internal class KiBoardsKibanaClient
{
private readonly HttpClient _httpClient;

public KibanaClient(HttpClient httpClinet, Uri kibanaUri)
public KiBoardsKibanaClient(Uri kibanaUri, HttpClient httpClinet)
{
_httpClient = httpClinet;
_httpClient.BaseAddress = kibanaUri;
Expand Down
6 changes: 3 additions & 3 deletions src/KiBoards/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ public Startup(IMessageSink messageSink)
var task = Task.Factory.StartNew(async () =>
{
var httpClient = new HttpClient();
var kibanaHost = Environment.GetEnvironmentVariable("KIB_KIBANA_HOST") ?? "http://localhost:5601";
var kibanaClient = new KibanaClient(httpClient, new Uri(kibanaHost));
var kibanaUri = new Uri(Environment.GetEnvironmentVariable("KIB_KIBANA_HOST") ?? "http://localhost:5601");
var kibanaClient = new KiBoardsKibanaClient(kibanaUri, httpClient);

WriteMessage(messageSink, $"Waiting for Kibana {kibanaHost}");
WriteMessage(messageSink, $"Waiting for Kibana {kibanaUri}");

await kibanaClient.WaitForKibanaAsync(CancellationToken.None);
await kibanaClient.SetDarkModeAsync(true, CancellationToken.None);
Expand Down

0 comments on commit 5c16747

Please sign in to comment.