Browse Source

Add `package` visibility modifier (#1674)

Gustavo Cairo 2 years ago
parent
commit
5e8afe90f6

+ 2 - 0
Plugins/GRPCSwiftPlugin/plugin.swift

@@ -53,6 +53,8 @@ struct GRPCSwiftPlugin {
         case `internal`
         /// The generated files should have `public` access level.
         case `public`
+        /// The generated files should have `package` access level.
+        case `package`
       }
 
       /// An array of paths to `.proto` files for this invocation.

+ 3 - 0
Sources/protoc-gen-grpc-swift/options.swift

@@ -40,6 +40,7 @@ final class GeneratorOptions {
   enum Visibility: String {
     case `internal` = "Internal"
     case `public` = "Public"
+    case `package` = "Package"
 
     var sourceSnippet: String {
       switch self {
@@ -47,6 +48,8 @@ final class GeneratorOptions {
         return "internal"
       case .public:
         return "public"
+      case .package:
+        return "package"
       }
     }
   }

+ 1 - 1
docs/plugin.md

@@ -27,7 +27,7 @@ when invoking `protoc`.
 
 The **Visibility** option determines the access control for generated code.
 
-- **Possible values:** Public, Internal
+- **Possible values:** Public, Internal, Package
 - **Default value:** Internal
 
 ### Server