Skip to content

Commit

Permalink
Add package visibility modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
gjcairo committed Oct 16, 2023
1 parent 8f03192 commit 9df25eb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Plugins/GRPCSwiftPlugin/plugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions Sources/protoc-gen-grpc-swift/options.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,16 @@ final class GeneratorOptions {
enum Visibility: String {
case `internal` = "Internal"
case `public` = "Public"
case `package` = "Package"

var sourceSnippet: String {
switch self {
case .internal:
return "internal"
case .public:
return "public"
case .package:
return "package"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9df25eb

Please sign in to comment.