Skip to content

Commit 6ebbf26

Browse files
committed
Documentation draft
1 parent 9d64f60 commit 6ebbf26

File tree

3 files changed

+66
-14
lines changed

3 files changed

+66
-14
lines changed

CODEOWNERS

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,14 @@
102102
# CommunityToolkit.Aspire.Hosting.SqlServer.Extensions
103103
/src/CommunityToolkit.Aspire.Hosting.SqlServer.Extensions/ @Alirexaa
104104
/tests/CommunityToolkit.Aspire.Hosting.SqlServer.Extensions.Tests/ @Alirexaa
105-
/examples/sqlserver-ext/ @Alirexaa
105+
/examples/sqlserver-ext/ @Alirexaa
106+
107+
# CommunityToolkit.Aspire.Minio.Client
108+
# CommunityToolkit.Aspire.Hosting.Minio
109+
110+
/examples/minio/ @Harold-Morgan
111+
/src/CommunityToolkit.Aspire.Hosting.Minio/ @Harold-Morgan
112+
/tests/CommunityToolkit.Aspire.Hosting.Minio.Tests/ @Harold-Morgan
113+
114+
/src/CommunityToolkit.Aspire.Minio.Client/ @Harold-Morgan
115+
/tests/CommunityToolkit.Aspire.Minio.Client.Tests/ @Harold-Morgan
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# CommunityToolkit.Aspire.Hosting.MinoO library
2+
3+
Provides extension methods and resource definitions for the .NET Aspire AppHost to support running [MiniO](https://min.io/) containers.
4+
5+
## Getting Started
6+
7+
### Install the package
8+
9+
In your AppHost project, install the package using the following command:
10+
11+
```dotnetcli
12+
dotnet add package CommunityToolkit.Aspire.Hosting.Minio
13+
```
14+
15+
### Example usage
16+
17+
Then, in the _Program.cs_ file of `AppHost`, add a Minio resource and consume the connection using the following methods:
18+
19+
```csharp
20+
var builder = DistributedApplication.CreateBuilder(args);
21+
22+
var minio = builder.AddMinio("minio");
23+
24+
var myService = builder.AddProject<Projects.MyService>()
25+
.WithReference(minio);
26+
27+
builder.Build().Run();
28+
```
29+
30+
## Additional Information
31+
32+
https://learn.microsoft.com/dotnet/aspire/community-toolkit/hosting-minio
33+
34+
## Feedback & contributing
35+
36+
https://github.com/CommunityToolkit/Aspire
37+

src/CommunityToolkit.Aspire.Minio.Client/README.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Registers a [MiniOClient](https://github.com/minio/minio-dotnet) in the DI conta
1010

1111
### Install the package
1212

13-
Install the .NET Aspire Minio Client library with [NuGet](https://www.nuget.org):
13+
Install the .NET Aspire MiniO Client library with [NuGet](https://www.nuget.org):
1414

1515
```dotnetcli
1616
dotnet add package CommunityToolkit.Aspire.Minio.Client
@@ -26,37 +26,41 @@ builder.AddMinioClient();
2626

2727
## Configuration
2828

29-
The .NET Aspire Minio Client integration provides multiple options to configure the server connection based on the requirements and conventions of your project.
29+
The .NET Aspire MiniO Client integration provides multiple options to configure the server connection based on the requirements and conventions of your project.
3030

3131
### Use a connection string
3232

3333
When using a connection string from the `ConnectionStrings` configuration section, you can provide the name of the connection string when calling `builder.AddMinioClient()`:
3434

3535
```csharp
36-
builder.AddMeilisearchClient("minio");
36+
builder.AddMinioClient("minio");
3737
```
3838

3939
And then the connection string will be retrieved from the `ConnectionStrings` configuration section:
4040

4141
```json
4242
{
4343
"ConnectionStrings": {
44-
"minio": "Endpoint=http://localhost:19530/;MasterKey=123456!@#$%"
44+
"minio": "Endpoint=http://localhost:9001/;AccessKey=minioAdmin;SecretKey=minioAdmin"
4545
}
4646
}
4747
```
4848

4949
### Use configuration providers
5050

51-
The .NET Aspire Meilisearch Client integration supports [Microsoft.Extensions.Configuration](https://learn.microsoft.com/dotnet/api/microsoft.extensions.configuration). It loads the `MeilisearchClientSettings` from configuration by using the `Aspire:Meilisearch:Client` key. Example `appsettings.json` that configures some of the options:
51+
The .NET Aspire MiniO Client integration supports [Microsoft.Extensions.Configuration](https://learn.microsoft.com/dotnet/api/microsoft.extensions.configuration).
52+
It loads the `MinioClientSettings` from configuration by using the `Aspire:Minio:Client` key.
53+
This key can be overriden by using the `configurationSectionName` method parameter.
54+
Example `appsettings.json` that configures some of the options:
5255

5356
```json
5457
{
5558
"Aspire": {
56-
"Meilisearch": {
59+
"Minio": {
5760
"Client": {
58-
"Endpoint": "http://localhost:19530/",
59-
"MasterKey": "123456!@#$%"
61+
"Endpoint": "http://localhost:9001/",
62+
"AccessKey": "minioAdmin",
63+
"SecretKey": "minioAdmin"
6064
}
6165
}
6266
}
@@ -65,10 +69,10 @@ The .NET Aspire Meilisearch Client integration supports [Microsoft.Extensions.Co
6569

6670
### Use inline delegates
6771

68-
Also you can pass the `Action<MeilisearchClientSettings> configureSettings` delegate to set up some or all the options inline, for example to set the API key from code:
72+
Also you can pass the `Action<MinioClientSettings> configureSettings` delegate to set up some or all the options inline, for example to set the API key from code:
6973

7074
```csharp
71-
builder.AddMeilisearchClient("meilisearch", settings => settings.MasterKey = "123456!@#$%");
75+
builder.AddMinioClient("minio", configureSettings: settings => settings.SecretKey = "minioAdmin");
7276
```
7377

7478
## AppHost extensions
@@ -88,16 +92,17 @@ var myService = builder.AddProject<Projects.MyService>()
8892
.WithReference(minio);
8993
```
9094

91-
The `WithReference` method configures a connection in the `MyService` project named `minio`. In the _Program.cs_ file of `MyService`, the Minio connection can be consumed using:
95+
The `WithReference` method configures a connection in the `MyService` project named `minio`.
96+
In the _Program.cs_ file of `MyService`, the MiniO connection can be consumed using:
9297

9398
```csharp
9499
builder.AddMinioClient("minio");
95100
```
96101

97-
Then, in your service, inject `MeilisearchClient` and use it to interact with the Meilisearch API:
102+
Then, in your service, inject `IMinioClient` and use it to interact with the MiniO or other S3 compatible API:
98103

99104
```csharp
100-
public class MyService(MeilisearchClient meilisearchClient)
105+
public class MyService(IMinioClient minioClient)
101106
{
102107
// ...
103108
}

0 commit comments

Comments
 (0)