Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
kmrmt committed Nov 25, 2024
1 parent 9a4bb24 commit 74dc4d6
Show file tree
Hide file tree
Showing 14 changed files with 2,193 additions and 2,153 deletions.
47 changes: 34 additions & 13 deletions apis/docs/v1/doc.tmpl
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
{{ range .Files -}}
{{ range .Services -}}
{{- range .Files -}}
{{- range .Services -}}
{{- $descs := dict -}}
{{- range $desc := (splitList "---\n" .Description) -}}
{{- $lines := splitList "\n" $desc -}}
{{- $_ := set $descs (first $lines) (join "\n" (rest $lines)) -}}
{{- end -}}
# Vald {{ .Name }} APIs

## Overview
{{- if hasKey $descs "Overview" }}

{{.Description}}
{{ pluck "Overview" $descs | first }}

{{ end -}}
```rpc
service {{.Name}} {

{{ range .Methods }} rpc {{ .Name }}({{ .RequestFullType }}) returns ({{ .ResponseFullType }}) {}
{{ end }}
}
```
{{ range .Methods }}

{{ range .Methods -}}
{{- $descs := dict -}}
{{- range $desc := (splitList "---\n" .Description) -}}
{{- $lines := splitList "\n" $desc -}}
{{- $_ := set $descs (first $lines) (join "\n" (rest $lines)) -}}
{{- end -}}
## {{ .Name }} RPC
{{ if hasKey $descs "Overview" }}

{{ .Description }}
{{ pluck "Overview" $descs | first }}

{{ end }}
### Input

- the scheme of `{{ .RequestFullType }}`
Expand All @@ -37,16 +51,23 @@ service {{.Name}} {
```
{{ printf "{{ template \"field.%s\" }}" .ResponseFullType }}

{{ if hasKey $descs "Status Code" }}

### Status Code

| code | desc. |
| :--: | :---------------- |
| 0 | OK |
| 1 | CANCELLED |
| 3 | INVALID_ARGUMENT |
| 4 | DEADLINE_EXCEEDED |
| 5 | NOT_FOUND |
| 13 | INTERNAL |
{{ pluck "Status Code" $descs | first }}

Please refer to [Response Status Code](../status.md) for more details.

{{ end }}

{{- if hasKey $descs "Troubleshooting" }}

### Troubleshooting

{{ pluck "Troubleshooting" $descs | first }}

{{ end }}

{{ end -}}
{{- end -}}
Expand Down
Loading

0 comments on commit 74dc4d6

Please sign in to comment.