Skip to content

Commit

Permalink
chore: code format, add file header.
Browse files Browse the repository at this point in the history
  • Loading branch information
netcore-jroger committed Apr 14, 2024
1 parent 8c86207 commit 8be1baa
Show file tree
Hide file tree
Showing 36 changed files with 113 additions and 32 deletions.
4 changes: 3 additions & 1 deletion sample/ClientSample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) JRoger. All Rights Reserved.

using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
Expand Down
4 changes: 3 additions & 1 deletion sample/InterfaceLib/IUserService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) JRoger. All Rights Reserved.

using System;
using System.Threading;
using System.Threading.Tasks;
using Grpc.Core;
Expand Down
4 changes: 3 additions & 1 deletion sample/ServerSample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Microsoft.AspNetCore;
// Copyright (c) JRoger. All Rights Reserved.

using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;

namespace ServerSample;
Expand Down
4 changes: 3 additions & 1 deletion sample/ServerSample/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) JRoger. All Rights Reserved.

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.AspNetCore.Builder;
Expand Down
4 changes: 3 additions & 1 deletion sample/ServerSample/UserService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) JRoger. All Rights Reserved.

using System;
using System.Text.Json;
using System.Text.Encodings.Web;
using System.Text.Unicode;
Expand Down
2 changes: 2 additions & 0 deletions src/SimpleRpc.Client/DefaultRpcChannel.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) JRoger. All Rights Reserved.

using System;
using System.Threading;
using System.Threading.Tasks;
Expand Down
2 changes: 2 additions & 0 deletions src/SimpleRpc.Client/IRpcChannel.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) JRoger. All Rights Reserved.

using System.Threading;
using System.Threading.Tasks;
using Grpc.Core;
Expand Down
2 changes: 2 additions & 0 deletions src/SimpleRpc.Client/IRpcServiceDiscovery.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) JRoger. All Rights Reserved.

using System.Threading.Tasks;
using Microsoft.Extensions.Options;

Expand Down
4 changes: 3 additions & 1 deletion src/SimpleRpc.Client/Internal/GrpcClientBase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) JRoger. All Rights Reserved.

using System;
using System.Threading;
using System.Threading.Tasks;
using Grpc.Core;
Expand Down
4 changes: 3 additions & 1 deletion src/SimpleRpc.Client/Internal/GrpcClientTypeBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) JRoger. All Rights Reserved.

using System;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
Expand Down
4 changes: 3 additions & 1 deletion src/SimpleRpc.Client/RpcClientFactory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) JRoger. All Rights Reserved.

using System;
using System.Collections.Concurrent;
using System.Reflection;
using SimpleRpc.Client.Internal;
Expand Down
4 changes: 3 additions & 1 deletion src/SimpleRpc.Client/RpcClientOptions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace SimpleRpc.Client;
// Copyright (c) JRoger. All Rights Reserved.

namespace SimpleRpc.Client;

public class RpcClientOptions
{
Expand Down
4 changes: 3 additions & 1 deletion src/SimpleRpc.Client/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Microsoft.Extensions.Configuration;
// Copyright (c) JRoger. All Rights Reserved.

using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using SimpleRpc.Shared.Serializers;
Expand Down
4 changes: 3 additions & 1 deletion src/SimpleRpc.Server/IRpcHost.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Threading.Tasks;
// Copyright (c) JRoger. All Rights Reserved.

using System.Threading.Tasks;

namespace SimpleRpc.Server;

Expand Down
12 changes: 12 additions & 0 deletions src/SimpleRpc.Server/IRpcHostBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) JRoger. All Rights Reserved.

using System;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -45,6 +47,16 @@ string methodName
where TRequest : class
where TResponse : class;

/// <summary>
/// 添加 ServerStreamingMethod RPC 方法
/// </summary>
/// <typeparam name="TService"></typeparam>
/// <typeparam name="TRequest"></typeparam>
/// <typeparam name="TResponse"></typeparam>
/// <param name="handler"></param>
/// <param name="serviceName"></param>
/// <param name="methodName"></param>
/// <returns></returns>
IRpcHostBuilder AddServerStreamingMethod<TService, TRequest, TResponse>(
Func<TService, TRequest, CancellationToken, Task> handler,
string serviceName,
Expand Down
2 changes: 2 additions & 0 deletions src/SimpleRpc.Server/IRpcServiceRegister.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) JRoger. All Rights Reserved.

using System;
using System.Net.Http;
using System.Text;
Expand Down
4 changes: 3 additions & 1 deletion src/SimpleRpc.Server/IRpcServiceTypeFinder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) JRoger. All Rights Reserved.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
Expand Down
4 changes: 3 additions & 1 deletion src/SimpleRpc.Server/Internal/GrpcHost.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) JRoger. All Rights Reserved.

using System;
using System.Collections;
using System.Reflection;
using System.Text;
Expand Down
3 changes: 2 additions & 1 deletion src/SimpleRpc.Server/Internal/GrpcHostBuilderExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// Copyright (c) JRoger. All Rights Reserved.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using Grpc.Core;
using SimpleRpc.Shared;
using SimpleRpc.Shared.Description;
Expand Down
4 changes: 3 additions & 1 deletion src/SimpleRpc.Server/Internal/GrpcHostFactory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) JRoger. All Rights Reserved.

using System;
using System.Linq;
using Microsoft.Extensions.DependencyInjection;

Expand Down
4 changes: 3 additions & 1 deletion src/SimpleRpc.Server/Internal/MethodHandlerGenerator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) JRoger. All Rights Reserved.

using System;
using System.Linq.Expressions;
using System.Reflection;
using System.Threading;
Expand Down
4 changes: 3 additions & 1 deletion src/SimpleRpc.Server/RpcHostedService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) JRoger. All Rights Reserved.

using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
Expand Down
4 changes: 3 additions & 1 deletion src/SimpleRpc.Server/RpcServerOptions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace SimpleRpc.Server;
// Copyright (c) JRoger. All Rights Reserved.

namespace SimpleRpc.Server;

public class RpcServerOptions
{
Expand Down
4 changes: 3 additions & 1 deletion src/SimpleRpc.Server/RpcServiceBase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) JRoger. All Rights Reserved.

using System;
using Grpc.Core;
using SimpleRpc.Shared;

Expand Down
6 changes: 4 additions & 2 deletions src/SimpleRpc.Server/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using System;
// Copyright (c) JRoger. All Rights Reserved.

using System;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using SimpleRpc.Shared.Serializers;
using SimpleRpc.Server.Internal;
using SimpleRpc.Shared.Serializers;

namespace SimpleRpc.Server;

Expand Down
4 changes: 3 additions & 1 deletion src/SimpleRpc.Shared/ClientStreaming.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) JRoger. All Rights Reserved.

using System;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using Grpc.Core;
Expand Down
4 changes: 3 additions & 1 deletion src/SimpleRpc.Shared/Description/RpcMethodDescription.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) JRoger. All Rights Reserved.

using System;
using System.Reflection;
using System.Threading;
using Grpc.Core;
Expand Down
4 changes: 3 additions & 1 deletion src/SimpleRpc.Shared/Description/RpcServiceDescription.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) JRoger. All Rights Reserved.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
Expand Down
4 changes: 3 additions & 1 deletion src/SimpleRpc.Shared/IRpcService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace SimpleRpc.Shared
// Copyright (c) JRoger. All Rights Reserved.

namespace SimpleRpc.Shared
{
/// <summary>
/// 一个空接口,用于标记一个 RPC 服务。
Expand Down
4 changes: 3 additions & 1 deletion src/SimpleRpc.Shared/Internal/MethodDefinitionGenerator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Grpc.Core;
// Copyright (c) JRoger. All Rights Reserved.

using Grpc.Core;
using SimpleRpc.Shared.Serializers;
using System.Runtime.CompilerServices;

Expand Down
4 changes: 3 additions & 1 deletion src/SimpleRpc.Shared/RpcConfigInformation.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace SimpleRpc.Shared
// Copyright (c) JRoger. All Rights Reserved.

namespace SimpleRpc.Shared
{
public static class RpcConfigInformation
{
Expand Down
4 changes: 3 additions & 1 deletion src/SimpleRpc.Shared/RpcDefineException.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) JRoger. All Rights Reserved.

using System;

namespace SimpleRpc.Shared
{
Expand Down
4 changes: 3 additions & 1 deletion src/SimpleRpc.Shared/Serializers/ISerializer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace SimpleRpc.Shared.Serializers
// Copyright (c) JRoger. All Rights Reserved.

namespace SimpleRpc.Shared.Serializers
{
public interface ISerializer
{
Expand Down
4 changes: 3 additions & 1 deletion src/SimpleRpc.Shared/Serializers/ProtoBufSerializer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using ProtoBuf;
// Copyright (c) JRoger. All Rights Reserved.

using ProtoBuf;
using System.IO;

namespace SimpleRpc.Shared.Serializers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) JRoger. All Rights Reserved.

using System;
using Grpc.Core;

namespace SimpleRpc.Shared.ServiceAnnotations
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) JRoger. All Rights Reserved.

using System;

namespace SimpleRpc.Shared.ServiceAnnotations
{
Expand Down

0 comments on commit 8be1baa

Please sign in to comment.