Awesome Open Source
Awesome Open Source

FamilyBucket

FamilyBucket

https://awesomeopensource.com/project/q315523275/FamilyBucket
UI https://awesomeopensource.com/project/q315523275/FamilyBucket-UI
https://awesomeopensource.com/project/q315523275/FamilyBucket-Server
https://www.cnblogs.com/tianxiangzhe/p/10212337.html
Nuget Bucket.XXX


ocelotdotnetty
jwt
redis
RabbitMQ
Hangfire
RedisZookeeper
Log4NetNLog
MQ()
ORM SqlSugar
RPC DotNettyRpc()gRpc
Consul
SkyAPM net
WebSocket WebSocket
cupgchttp
AspNetCode Controller
ip
...


webapi https://github.com/q315523275/FamilyBucket/tree/master/src/Sample

        /// <summary>
        /// 
        /// </summary>
        public void ConfigureServices(IServiceCollection services)
        {
            // 
            services.AddFamilyBucket(familyBucket =>
            {
                // AspNetCore
                familyBucket.AddAspNetCore();
                // 
                familyBucket.AddApiJwtAuthorize().UseAuthoriser(builder => { builder.UseMySqlAuthorize(); });
                // ORM
                familyBucket.AddSqlSugarDbContext().AddSqlSugarDbRepository();
                // 
                familyBucket.AddErrorCodeServer();
                // 
                familyBucket.AddConfigServer();
                // 
                familyBucket.AddEventBus(builder => { builder.UseRabbitMQ(); });
                // 
                familyBucket.AddServiceDiscovery(builder => { builder.UseConsul(); });
                // 
                familyBucket.AddLoadBalancer();
                // 
                familyBucket.AddLogEventTransport();
                // 
                familyBucket.AddBucketSkyApmCore().UseEventBusTransport();
                // 
                familyBucket.AddCaching(build =>
                {
                    build.UseInMemory("default");
                    build.UseStackExchangeRedis(new Caching.StackExchangeRedis.Abstractions.StackExchangeRedisOption
                    {
                        Configuration = "10.10.188.136:6379,allowadmin=true",
                        DbProviderName = "redis"
                    });
                });
                // 
                familyBucket.AddUtil();
                // 
                familyBucket.AddAspNetCoreHostedService(builder => { builder.AddConfig().AddErrorCode().AddAuthorize(); });
                // 
                familyBucket.AddListener(builder => { builder.UseRedis().AddAuthorize().AddConfig().AddErrorCode(); }); // builder.UseZookeeper();
                // 
                familyBucket.BatchRegisterService(Assembly.Load("Bucket.Demo.Repository"), "Repository", ServiceLifetime.Scoped);
                // DotNetty_Rpc
                familyBucket.AddRpcCore().UseDotNettyTransport().UseMessagePackCodec().AddClientRuntime().AddServiceProxy(); //.UseProtoBufferCodec()
            });
            // 
            services.AddMvc(option => { option.Filters.Add(typeof(WebApiActionFilterAttribute)); }).AddJsonOptions(options =>
            {
                options.SerializerSettings.ContractResolver = new DefaultContractResolver();
                options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss.fff";
            }).SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
            // 
            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new Info { Title = "", Version = "v1" });
                c.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, "Bucket.WebApi.xml"));
                c.CustomSchemaIds(x => x.FullName);
                // Swagger
                c.AddSecurityDefinition("Bearer", new ApiKeyScheme { In = "header", Description = "BearerToken", Name = "Authorization", Type = "apiKey" });
                c.AddSecurityRequirement(new Dictionary<string, IEnumerable<string>> { { "Bearer", Enumerable.Empty<string>() } });
            });
            // HttpClient
            services.AddHttpClient();
            // 

            // 
            RegisterEventBus(services);
            // 
            RegisterScheduler(services);
        }

  • ocelot2ms

VNext


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
C Sharp (278,450
Elasticsearch (3,821
Grpc (2,249
Consul (784
Tracing (607
Eventbus (483
Netcore2 (248
Related Projects