Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 69055ea

Browse files
committed
add swagger docs
1 parent 3a7ae83 commit 69055ea

File tree

6 files changed

+80
-3
lines changed

6 files changed

+80
-3
lines changed

coderd/apidoc/docs.go

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/coderd.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -630,9 +630,7 @@ func New(options *Options) *API {
630630
},
631631
)
632632

633-
r.HandleFunc("/coordinator", func(w http.ResponseWriter, r *http.Request) {
634-
(*api.TailnetCoordinator.Load()).ServeHTTPDebug(w, r)
635-
})
633+
r.HandleFunc("/coordinator", api.debugCoordinator)
636634
})
637635
})
638636

coderd/debug.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package coderd
2+
3+
import "net/http"
4+
5+
// @Summary Wireguard Coordinator Debug Info
6+
// @ID debuginfo-coordinator
7+
// @Security CoderSessionToken
8+
// @Produce html
9+
// @Tags Debug
10+
// @Success 200
11+
// @Router /debug/coordinator [get]
12+
func (api *API) debugCoordinator(rw http.ResponseWriter, r *http.Request) {
13+
(*api.TailnetCoordinator.Load()).ServeHTTPDebug(rw, r)
14+
}

docs/api/debug.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Debug
2+
3+
## Wireguard Coordinator Debug Info
4+
5+
### Code samples
6+
7+
```shell
8+
# Example request using curl
9+
curl -X GET http://coder-server:8080/api/v2/debug/coordinator \
10+
-H 'Coder-Session-Token: API_KEY'
11+
```
12+
13+
`GET /debug/coordinator`
14+
15+
### Responses
16+
17+
| Status | Meaning | Description | Schema |
18+
| ------ | ------------------------------------------------------- | ----------- | ------ |
19+
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | |
20+
21+
To perform this operation, you must be authenticated. [Learn more](authentication.md).

docs/manifest.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,10 @@
364364
"title": "Builds",
365365
"path": "./api/builds.md"
366366
},
367+
{
368+
"title": "Debug",
369+
"path": "./api/debug.md"
370+
},
367371
{
368372
"title": "Enterprise",
369373
"path": "./api/enterprise.md"

0 commit comments

Comments
 (0)