Structuregrpc-swift 2.0.0GRPCCodeGen
Config
User options for the CodeGeneration.
struct Config
User options for the CodeGeneration.
struct Config
import GRPCCodeGen
struct CodeGenerator
Generates SourceFile
objects containing generated code for the RPCs represented in a CodeGenerationRequest
object.
init(config: Config)
var config: Config
The options regarding the access level, indentation for the generated code and whether to generate server and client code.
func generate(_ request: CodeGenerationRequest) throws -> SourceFile
Transforms a CodeGenerationRequest
object into a SourceFile
object containing the generated code.
protocol Sendable
init(accessLevel: AccessLevel, accessLevelOnImports: Bool, client: Bool, server: Bool, indentation: Int = 4)
Creates a new configuration.
var accessLevel: AccessLevel
The access level the generated code will have.
var accessLevelOnImports: Bool
Whether imports have explicit access levels.
var client: Bool
Whether or not client code should be generated.
var indentation: Int
The indentation of the generated code as the number of spaces.
var server: Bool
Whether or not server code should be generated.
struct AccessLevel
The possible access levels for the generated code.