-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #436 from fhalim/feature/oneof
Support oneof in templates
- Loading branch information
Showing
6 changed files
with
121 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# API Reference | ||
|
||
# Table of Contents | ||
{{range .Files}} | ||
{{if .HasServices}} | ||
- Services | ||
{{range .Services}} - [{{.Name}}](#{{.FullName | lower | replace "." ""}}) | ||
{{end}} | ||
{{end}} | ||
{{if .HasMessages}} | ||
- Messages | ||
{{range .Messages}} - [{{.LongName}}](#{{.LongName | lower | replace "." ""}}) | ||
{{end}} | ||
{{end}} | ||
{{if .HasEnums}} | ||
- Enums | ||
{{range .Enums}} - [{{.LongName}}](#{{.LongName | lower | replace "." ""}}) | ||
{{end}} | ||
{{end}} | ||
{{end}} | ||
- [Scalar Value Types](#scalar-value-types) | ||
|
||
{{range .Files}} | ||
|
||
{{range .Services -}} | ||
# {{.Name}} {#{{.FullName | lower | replace "." ""}}} | ||
{{.Description}} | ||
|
||
{{range .Methods -}} | ||
## {{.Name}} | ||
|
||
> **rpc** {{.Name}}([{{.RequestLongType}}](#{{.RequestLongType | lower | replace "." ""}})) | ||
[{{.ResponseLongType}}](#{{.ResponseLongType | lower | replace "." ""}}) | ||
|
||
{{ .Description}} | ||
{{end}} <!-- end methods --> | ||
{{end}} <!-- end services --> | ||
|
||
# Messages | ||
{{range .Messages}} | ||
|
||
## {{.LongName}} {#{{.LongName | lower | replace "." ""}}} | ||
{{.Description}} | ||
|
||
{{if .HasFields}} | ||
| Field | Type | Description | | ||
| ----- | ---- | ----------- | | ||
{{range .Fields -}} | ||
| {{if .IsOneof}}[**oneof**](https://developers.google.com/protocol-buffers/docs/proto3#oneof) {{.OneofDecl}}.{{end}}{{.Name}} | [{{if .IsMap}}map {{else}}{{.Label}} {{end}}{{.LongType}}](#{{.LongType | lower | replace "." ""}}) | {{if .Description}}{{nobr .Description}}{{if .DefaultValue}} Default: {{.DefaultValue}}{{end}}{{else}}none{{end}} | | ||
{{end}} <!-- end Fields --> | ||
{{end}} <!-- end HasFields --> | ||
{{end}} <!-- end messages --> | ||
|
||
# Enums | ||
{{range .Enums}} | ||
|
||
## {{.LongName}} {#{{.LongName | lower | replace "." ""}}} | ||
{{.Description}} | ||
|
||
| Name | Number | Description | | ||
| ---- | ------ | ----------- | | ||
{{range .Values -}} | ||
| {{.Name}} | {{.Number}} | {{if .Description}}{{nobr .Description}}{{else}}none{{end}} | | ||
{{end}} | ||
|
||
{{end}} <!-- end Enums --> | ||
{{end}} <!-- end Files --> | ||
|
||
# Scalar Value Types | ||
|
||
| .proto Type | Notes | C++ Type | Java Type | Python Type | | ||
| ----------- | ----- | -------- | --------- | ----------- | | ||
{{range .Scalars -}} | ||
| <div><h4 id="{{.ProtoType | lower | replace "." ""}}" /></div><a name="{{.ProtoType}}" /> {{.ProtoType}} | {{.Notes}} | {{.CppType}} | {{.JavaType}} | {{.PythonType}} | | ||
{{end}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters