Skip to content

Commit c9d67b0

Browse files
committed
Refactor naming
1 parent 2610741 commit c9d67b0

25 files changed

+112
-75
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,10 @@ dotnet_diagnostic.IDE0305.severity = none
247247
dotnet_diagnostic.IDE0072.severity = none
248248

249249

250+
[src/api/AwsLambda/**/*.cs]
251+
dotnet_diagnostic.IL3050.severity = none
252+
dotnet_diagnostic.IL2026.severity = none
253+
250254

251255
[DocumentationWebHost.cs]
252256
dotnet_diagnostic.IL3050.severity = none

.github/workflows/build-api-lambda.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ jobs:
1616
build:
1717
runs-on: ubuntu-latest
1818
env:
19-
BINARY_PATH: .artifacts/AwsLambda/release_linux-x64/bootstrap
19+
BINARY_PATH: .artifacts/Elastic.Documentation.Api.Lambda/release_linux-x64/bootstrap
2020
steps:
2121
- uses: actions/checkout@v4
2222
with:
2323
ref: ${{ inputs.ref }}
2424
- name: Amazon Linux 2023 build
2525
run: |
26-
docker build . -t api-lambda:latest -f src/api/AwsLambda/Dockerfile
26+
docker build . -t api-lambda:latest -f src/api/Elastic.Documentation.Api.Lambda/Dockerfile
2727
- name: Get bootstrap binary
2828
run: |
2929
docker cp $(docker create --name tc api-lambda:latest):/app/.artifacts/publish ./.artifacts && docker rm tc

docs-builder.sln

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "config", "config", "{6FAB56
121121
EndProject
122122
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "api", "api", "{B042CC78-5060-4091-B95A-79C71BA3908A}"
123123
EndProject
124-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core", "src\api\Core\Core.csproj", "{F30B90AD-1A01-4A6F-9699-809FA6875B22}"
124+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elastic.Documentation.Api.Core", "src\api\Elastic.Documentation.Api.Core\Elastic.Documentation.Api.Core.csproj", "{F30B90AD-1A01-4A6F-9699-809FA6875B22}"
125125
EndProject
126-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Infrastructure", "src\api\Infrastructure\Infrastructure.csproj", "{AE3FC78E-167F-4B6E-88EC-84743EB748B7}"
126+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elastic.Documentation.Api.Infrastructure", "src\api\Elastic.Documentation.Api.Infrastructure\Elastic.Documentation.Api.Infrastructure.csproj", "{AE3FC78E-167F-4B6E-88EC-84743EB748B7}"
127127
EndProject
128-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AwsLambda", "src\api\AwsLambda\AwsLambda.csproj", "{C6A121C5-DEB1-4FCE-9140-AF144EA98EEE}"
128+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elastic.Documentation.Api.Lambda", "src\api\Elastic.Documentation.Api.Lambda\Elastic.Documentation.Api.Lambda.csproj", "{C6A121C5-DEB1-4FCE-9140-AF144EA98EEE}"
129129
EndProject
130130
Global
131131
GlobalSection(SolutionConfigurationPlatforms) = preSolution

src/api/Core/AskAi/AskAiRequest.cs renamed to src/api/Elastic.Documentation.Api.Core/AskAi/AskAiRequest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5-
namespace Api.Core.AskAi;
5+
namespace Elastic.Documentation.Api.Core.AskAi;
66

7-
public record AskAiRequest(string Message, string? ThreadId);

src/api/Core/AskAi/AskAiUsecase.cs renamed to src/api/Elastic.Documentation.Api.Core/AskAi/AskAiUsecase.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
using Microsoft.Extensions.Logging;
66

7-
namespace Api.Core.AskAi;
7+
namespace Elastic.Documentation.Api.Core.AskAi;
88

99
public class AskAiUsecase(IAskAiGateway<Stream> askAiGateway, ILogger<AskAiUsecase> logger)
1010
{
@@ -14,3 +14,5 @@ public async Task<Stream> AskAi(AskAiRequest askAiRequest, Cancel ctx)
1414
return await askAiGateway.AskAi(askAiRequest, ctx);
1515
}
1616
}
17+
18+
public record AskAiRequest(string Message, string? ThreadId);

src/api/Core/AskAi/IAskAiGateway.cs renamed to src/api/Elastic.Documentation.Api.Core/AskAi/IAskAiGateway.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5-
namespace Api.Core.AskAi;
5+
namespace Elastic.Documentation.Api.Core.AskAi;
66

77
public interface IAskAiGateway<T>
88
{

src/api/Core/Core.csproj renamed to src/api/Elastic.Documentation.Api.Core/Elastic.Documentation.Api.Core.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<TargetFramework>net9.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
7-
<AssemblyName>Api.Core</AssemblyName>
8-
<RootNamespace>Api.Core</RootNamespace>
7+
<AssemblyName>Elastic.Documentation.Api.Core</AssemblyName>
8+
<RootNamespace>Elastic.Documentation.Api.Core</RootNamespace>
99
</PropertyGroup>
1010

1111
<ItemGroup>

src/api/Core/SerializationContext.cs renamed to src/api/Elastic.Documentation.Api.Core/SerializationContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
// See the LICENSE file in the project root for more information
44

55
using System.Text.Json.Serialization;
6-
using Api.Core.AskAi;
6+
using Elastic.Documentation.Api.Core.AskAi;
77

8-
namespace Api.Core;
8+
namespace Elastic.Documentation.Api.Core;
99

1010

1111
[JsonSerializable(typeof(AskAiRequest))]

src/api/Infrastructure/Adapters/GcpIdTokenProvider.cs renamed to src/api/Elastic.Documentation.Api.Infrastructure/Adapters/GcpIdTokenProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using System.Text.Json;
88
using System.Text.Json.Serialization;
99

10-
namespace Api.Infrastructure.Adapters;
10+
namespace Elastic.Documentation.Api.Infrastructure.Adapters;
1111

1212
// This is a custom implementation to create an ID token for GCP.
1313
// Because Google.Api.Auth.OAuth2 is not compatible with AOT

src/api/Infrastructure/Adapters/LlmGatewayChatGateway.cs renamed to src/api/Elastic.Documentation.Api.Infrastructure/Adapters/LlmGatewayChatGateway.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
using System.Text;
66
using System.Text.Json;
77
using System.Text.Json.Serialization;
8-
using Api.Core.AskAi;
8+
using Elastic.Documentation.Api.Core.AskAi;
99

10-
namespace Api.Infrastructure.Adapters;
10+
namespace Elastic.Documentation.Api.Infrastructure.Adapters;
1111

1212
public class LlmGatewayAskAiGateway(HttpClient httpClient, GcpIdTokenProvider tokenProvider, string gcpFunctionUrl) : IAskAiGateway<Stream>
1313
{

0 commit comments

Comments
 (0)