GrpcExtensionsOptions.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. using System.Collections.Generic;
  3. namespace Grpc.Extension
  4. {
  5. /// <summary>
  6. /// GrpcServerOptions
  7. /// </summary>
  8. public class GrpcExtensionsOptions
  9. {
  10. private static Lazy<GrpcExtensionsOptions> instance = new Lazy<GrpcExtensionsOptions>(() => new GrpcExtensionsOptions(), true);
  11. public static GrpcExtensionsOptions Instance => instance.Value;
  12. private GrpcExtensionsOptions()
  13. {
  14. }
  15. /// <summary>
  16. /// grpc服务的包名
  17. /// </summary>
  18. public string GlobalPackage { get; set; }
  19. /// <summary>
  20. /// grpc服务的对外服务名
  21. /// </summary>
  22. public string GlobalService { get; set; }
  23. /// <summary>
  24. /// 是否输出响应内容
  25. /// </summary>
  26. public bool GlobalSaveResponseEnable { get; set; } = false;
  27. /// <summary>
  28. /// 生成proto文件的c#命名空间
  29. /// </summary>
  30. public string ProtoNameSpace { get; set; }
  31. /// <summary>
  32. /// 是否为基础服务生成proto文件
  33. /// </summary>
  34. public bool GenBaseServiceProtoEnable = false;
  35. /// <summary>
  36. /// 生成Json对象时排除前缀
  37. /// </summary>
  38. internal List<string> FillPropExcludePrefixs { get; set; } = new List<string> { "Google." };
  39. }
  40. }