Skip to content

Commit

Permalink
docs: package readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
catcherwong committed May 30, 2022
1 parent 17a7dad commit 8c8e587
Show file tree
Hide file tree
Showing 11 changed files with 158 additions and 0 deletions.
2 changes: 2 additions & 0 deletions parsers/Nacos.IniParser/Nacos.IniParser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<RepositoryUrl>https://github.com/nacos-group/nacos-sdk-csharp</RepositoryUrl>
<ProjectUrl>https://github.com/nacos-group/nacos-sdk-csharp</ProjectUrl>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>
</PackageReleaseNotes>
</PropertyGroup>
Expand All @@ -24,6 +25,7 @@

<ItemGroup>
<None Include="../../LICENSE" Pack="true" Visible="false" PackagePath="" />
<None Include="README.md" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
Expand Down
21 changes: 21 additions & 0 deletions parsers/Nacos.IniParser/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# nacos-sdk-csharp.IniParser

nacos-sdk-csharp.IniParser provides ini format config parser.

```csharp
builder.Host.UseNacosConfig(section: "NacosConfig", parser: Nacos.IniParser.IniConfigurationStringParser.Instance);

// or
builder.Host.ConfigureAppConfiguration((c, b) =>
{
var config = b.Build();

b.AddNacosV2Configuration(config.GetSection("NacosConfig"), parser: Nacos.IniParser.IniConfigurationStringParser.Instance);
});
```

## Links

* [Documentation](https://nacos-sdk-csharp.readthedocs.io/en/latest/)
* [nacos-sdk-csharp GitHub](https://github.com/nacos-group/nacos-sdk-csharp)
2 changes: 2 additions & 0 deletions parsers/Nacos.YamlParser/Nacos.YamlParser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<RepositoryUrl>https://github.com/nacos-group/nacos-sdk-csharp</RepositoryUrl>
<ProjectUrl>https://github.com/nacos-group/nacos-sdk-csharp</ProjectUrl>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>
</PackageReleaseNotes>
</PropertyGroup>
Expand All @@ -24,6 +25,7 @@

<ItemGroup>
<None Include="../../LICENSE" Pack="true" Visible="false" PackagePath="" />
<None Include="README.md" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
Expand Down
21 changes: 21 additions & 0 deletions parsers/Nacos.YamlParser/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# nacos-sdk-csharp.YamlParser

nacos-sdk-csharp.YamlParser provides yaml/yml format config parser.

```csharp
builder.Host.UseNacosConfig(section: "NacosConfig", parser: Nacos.YamlParser.YamlConfigurationStringParser.Instance);

// or
builder.Host.ConfigureAppConfiguration((c, b) =>
{
var config = b.Build();

b.AddNacosV2Configuration(config.GetSection("NacosConfig"), parser: Nacos.YamlParser.YamlConfigurationStringParser.Instance);
});
```

## Links

* [Documentation](https://nacos-sdk-csharp.readthedocs.io/en/latest/)
* [nacos-sdk-csharp GitHub](https://github.com/nacos-group/nacos-sdk-csharp)
2 changes: 2 additions & 0 deletions src/Nacos.AspNetCore/Nacos.AspNetCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<RepositoryUrl>https://github.com/nacos-group/nacos-sdk-csharp</RepositoryUrl>
<ProjectUrl>https://github.com/nacos-group/nacos-sdk-csharp</ProjectUrl>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>
</PackageReleaseNotes>
</PropertyGroup>
Expand All @@ -28,6 +29,7 @@

<ItemGroup>
<None Include="../../LICENSE" Pack="true" Visible="false" PackagePath="" />
<None Include="README.md" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
Expand Down
31 changes: 31 additions & 0 deletions src/Nacos.AspNetCore/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# nacos-sdk-csharp.AspNetCore

nacos-sdk-csharp.AspNetCore provides service registration and discovery With ASP.NET Core.

```csharp
builder.Services.AddNacosAspNet(x =>
{
x.ServerAddresses = new List<string> { "http://localhost:8848/" };
x.Namespace = "cs";
x.ServiceName = "App2";
x.GroupName = "DEFAULT_GROUP";
x.ClusterName = "DEFAULT";
x.Ip = "";
x.PreferredNetworks = "";
x.Port = 0;
x.Weight = 100;
x.RegisterEnabled = true;
x.InstanceEnabled = true;
x.Ephemeral = true;
x.Secure = false;
});

// or
builder.Services.AddNacosAspNet(builder.Configuration);
```

## Links

* [Documentation](https://nacos-sdk-csharp.readthedocs.io/en/latest/)
* [nacos-sdk-csharp GitHub](https://github.com/nacos-group/nacos-sdk-csharp)
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<RepositoryUrl>https://github.com/nacos-group/nacos-sdk-csharp</RepositoryUrl>
<ProjectUrl>https://github.com/nacos-group/nacos-sdk-csharp</ProjectUrl>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>
</PackageReleaseNotes>
</PropertyGroup>
Expand All @@ -24,6 +25,7 @@

<ItemGroup>
<None Include="../../LICENSE" Pack="true" Visible="false" PackagePath="" />
<None Include="README.md" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
Expand Down
28 changes: 28 additions & 0 deletions src/Nacos.Microsoft.Extensions.Configuration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# nacos-sdk-csharp.Extensions.Configuration

nacos-sdk-csharp.Extensions.Configuration provides integration with ASP.NET Core Configuration System.

```csharp
builder.Host.UseNacosConfig(section: "NacosConfig");

// or
builder.Host.ConfigureAppConfiguration((c, b) =>
{
var config = b.Build();

// read configuration from config files
// default is json
// b.AddNacosV2Configuration(config.GetSection("NacosConfig"));
b.AddNacosV2Configuration(config.GetSection("NacosConfig"));

// specify ini or yaml
b.AddNacosV2Configuration(config.GetSection("NacosConfig"), parser: Nacos.IniParser.IniConfigurationStringParser.Instance);
b.AddNacosV2Configuration(config.GetSection("NacosConfig"), parser: Nacos.YamlParser.YamlConfigurationStringParser.Instance);
});
```

## Links

* [Documentation](https://nacos-sdk-csharp.readthedocs.io/en/latest/)
* [nacos-sdk-csharp GitHub](https://github.com/nacos-group/nacos-sdk-csharp)
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<RepositoryUrl>https://github.com/nacos-group/nacos-sdk-csharp</RepositoryUrl>
<ProjectUrl>https://github.com/nacos-group/nacos-sdk-csharp</ProjectUrl>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>
</PackageReleaseNotes>

Expand All @@ -24,6 +25,7 @@
<Compile Include="../Nacos.Microsoft.Extensions.Configuration/DefaultJsonConfigurationStringParser.cs" />

<None Include="../../LICENSE" Pack="true" Visible="false" PackagePath="" />
<None Include="README.md" Pack="true" Visible="false" PackagePath="" />

<ProjectReference Include="..\Nacos\Nacos.csproj" />

Expand Down
2 changes: 2 additions & 0 deletions src/Nacos/Nacos.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<RepositoryUrl>https://github.com/nacos-group/nacos-sdk-csharp</RepositoryUrl>
<ProjectUrl>https://github.com/nacos-group/nacos-sdk-csharp</ProjectUrl>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>
</PackageReleaseNotes>
</PropertyGroup>
Expand All @@ -24,6 +25,7 @@

<ItemGroup>
<None Include="../../LICENSE" Pack="true" Visible="false" PackagePath="" />
<None Include="README.md" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
Expand Down
45 changes: 45 additions & 0 deletions src/Nacos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# nacos-sdk-csharp

nacos-sdk-csharp provides basic nacos operation.

```csharp
// config
builder.Services.AddNacosV2Config(x =>
{
x.ServerAddresses = new List<string> { "http://localhost:8848/" };
x.Namespace = "cs";
x.UserName = "nacos";
x.Password = "nacos";
});

// naming
builder.Services.AddNacosV2Naming(x =>
{
x.ServerAddresses = new List<string> { "http://localhost:8848/" };
x.Namespace = "cs";
x.UserName = "nacos";
x.Password = "nacos";
});

// or
builder.Services.AddNacosV2Config(builder.Configuration);

builder.Services.AddNacosV2Naming(builder.Configuration);
```

```csharp
private readonly INacosConfigService _config;
private readonly INacosNamingService _naming;

public TheCtor(INacosConfigService config, INacosNamingService naming)
{
_config = config;
_naming = naming;
}
```

## Links

* [Documentation](https://nacos-sdk-csharp.readthedocs.io/en/latest/)
* [nacos-sdk-csharp GitHub](https://github.com/nacos-group/nacos-sdk-csharp)

0 comments on commit 8c8e587

Please sign in to comment.