Awesome Open Source
Awesome Open Source

Silky

GitHub license Commit NuGet MyGet (nightly builds) NuGet Download Hits

** | English**

silky.net, RPC **** silky silky silky

silky

silky.png

+

  • silky

RPC

  • DotnettyTCP,
  • JSONMessagePackProtoBuf
  • RPC,
  • RPC

  • ,
  • RPC
  • ,
  • HTTPRPC
  • ,n
  • RPC
  • ,RPCFabllback

.net

  • web
  • websocket

  • rpc tokenRPC,rpc
  • RPCssl

  • Json
  • Yaml
  • Apollo

  • HTTP
  • RPC
  • TCC
  • (EFCore)...

  • RPC,TCC
  • +TODO
  • RedisTODO

websocket

Silky.Hero

https://github.com/liuhll/silky.hero

https://hero.silky-fk.com/

  • (silky)
    • (): admin(123qweR!)
    • : liuhll(123qweR!)
    • : 123qweR!

1.

web, nugetSilky.Agent.Host

PM> Install-Package Silky.Agent.Host

Main``HostBuilder

public class Program
{
  public static Task Main(string[] args)
  {
    return CreateHostBuilder(args).Build().RunAsync();
  }

  private static IHostBuilder CreateHostBuilder(string[] args) =>
    Host.CreateDefaultBuilder(args)
      .ConfigureSilkyWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>();});
   
}

Startup

public void ConfigureServices(IServiceCollection services)
{
  services.AddSilkyHttpCore()
    .AddSwaggerDocuments()
    .AddRouting();
}

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
  if (env.IsDevelopment())
  {
    app.UseDeveloperExceptionPage();
    app.UseSwaggerDocuments();
  }

  app.UseRouting();

  app.UseEndpoints(endpoints => { endpoints.MapSilkyRpcServices(); });
}

2.

SilkyRpcredis

,,Rpc:Token``Rpc:Port``2200,Rpc:Host``0.0.0.0

appsettings.json:

  {
    "RegistryCenter": {
    "Type": "Zookeeper",
    "ConnectionStrings": "127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183;127.0.0.1:2184,127.0.0.1:2185,127.0.0.1:2186"
  },
  "DistributedCache": {
    "Redis": {
      "IsEnabled": true,
      "Configuration": "127.0.0.1:6379,defaultDatabase=0"
    }
  },
  "Rpc": {
    "Token": "ypjdYOzNd4FwENJiEARMLWwK0v7QUHPW",
    "Port": 2200
  }
  }

3.

,,

,[ServiceRoute]

[ServiceRoute]
public interface IGreetingAppService
{   
    Task<string> Get();
}

4.

,

public class GreetingAppService : IGreetingAppService
{
  public Task<string> Get()
  {
    return Task.FromResult("Hello World");
  }
}

5. RPC

,SilkyRpc

6. Swagger

,,http://127.0.0.1:5000/index.html swagger,api

silky


# ,
> dotnet new --install Silky.Module.Template

# ,
> dotnet new --install Silky.App.Template

dotnet new silky.app -in -p:i -n Demo

  • issue Pull Request
Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
C Sharp (169,782
Microservices (12,151
Rpc (8,162
Swagger (8,104
Asp Net Core (3,529
Saas (1,494
Distributed Transactions (117
Microservice Architecture (32
Tcc Transaction (8
Silky (4