Documentation
¶
Overview ¶
Package swift provides a code generator for Swift.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
func Generate(ctx context.Context, model *api.API, outdir string, cfg *parser.ModelConfig, swiftCfg *config.SwiftPackage) error
Generate generates code from the model.
func PackageName ¶
PackageName returns the package name for the API.
Types ¶
type DecodingStyle ¶ added in v0.21.0
type DecodingStyle int
DecodingStyle defines an enumeration for decoding fields.
const ( // DecodingSimple means that the field is decoded using a simple `.decode()` // call. DecodingSimple DecodingStyle = iota // DecodingOptional means that the field is decoded using a // `.decodeIfPresent()` call. DecodingOptional // DecodingMapCustomKey means that the field is a map, with non-string keys // and requires mapping through a string-keyed temporary. DecodingMapCustomKey )
type Dependency ¶ added in v0.10.1
type Dependency struct {
config.SwiftDependency
}
Dependency wraps config.SwiftDependency to add helper methods.
func (*Dependency) LocalName ¶ added in v0.10.1
func (dep *Dependency) LocalName() string
LocalName returns the name of the dependency when used in a `Package.swift` file.
For local dependencies this is the last directory in the path. For external dependencies this is the last directory of the URL path.
type EncodingStyle ¶ added in v0.21.0
type EncodingStyle int
EncodingStyle defines an enumeration for encoding fields.
const ( // EncodingSimple means that the field is encoded using a simple `.encode()` call. EncodingSimple EncodingStyle = iota // EncodingMapCustomKey means that the field is a map, with non-string keys // and requires mapping through a string-keyed temporary. EncodingMapCustomKey )
Source Files
¶
- annotate_enum.go
- annotate_enum_value.go
- annotate_field.go
- annotate_message.go
- annotate_method.go
- annotate_model.go
- annotate_oneof.go
- annotate_sample_info.go
- annotate_service.go
- codec.go
- dependency.go
- doc_link.go
- field_type_name.go
- format_documentation.go
- format_path.go
- generate.go
- lookup.go
- map.go
- names.go
- package_name.go
Click to show internal directories.
Click to hide internal directories.