Skip to content

Commit 5e8afe9

Browse files
authored
Add package visibility modifier (grpc#1674)
1 parent 8f03192 commit 5e8afe9

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

Plugins/GRPCSwiftPlugin/plugin.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ struct GRPCSwiftPlugin {
5353
case `internal`
5454
/// The generated files should have `public` access level.
5555
case `public`
56+
/// The generated files should have `package` access level.
57+
case `package`
5658
}
5759

5860
/// An array of paths to `.proto` files for this invocation.

Sources/protoc-gen-grpc-swift/options.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,16 @@ final class GeneratorOptions {
4040
enum Visibility: String {
4141
case `internal` = "Internal"
4242
case `public` = "Public"
43+
case `package` = "Package"
4344

4445
var sourceSnippet: String {
4546
switch self {
4647
case .internal:
4748
return "internal"
4849
case .public:
4950
return "public"
51+
case .package:
52+
return "package"
5053
}
5154
}
5255
}

docs/plugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ when invoking `protoc`.
2727

2828
The **Visibility** option determines the access control for generated code.
2929

30-
- **Possible values:** Public, Internal
30+
- **Possible values:** Public, Internal, Package
3131
- **Default value:** Internal
3232

3333
### Server

0 commit comments

Comments
 (0)