rename apidocs into api (#4844)

this is to follow standard Golang project layout
This commit is contained in:
Alessandro Ros
2025-08-09 16:05:34 +02:00
committed by GitHub
parent 69d37cc6c6
commit 1f3014aeac
8 changed files with 8 additions and 8 deletions

View File

@@ -2,7 +2,7 @@
# do not add /binaries, since it is needed by Docker images # do not add /binaries, since it is needed by Docker images
/tmp /tmp
/coverage*.txt /coverage*.txt
/apidocs/*.html /api/*.html
/internal/core/VERSION /internal/core/VERSION
/internal/servers/hls/hls.min.js /internal/servers/hls/hls.min.js
/internal/staticsources/rpicamera/mtxrpicam_*/ /internal/staticsources/rpicamera/mtxrpicam_*/

View File

@@ -170,9 +170,9 @@ jobs:
- run: make apidocs - run: make apidocs
- run: mv apidocs/*.html apidocs/index.html - run: mv api/*.html api/index.html
- uses: peaceiris/actions-gh-pages@v4 - uses: peaceiris/actions-gh-pages@v4
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./apidocs publish_dir: ./api

2
.gitignore vendored
View File

@@ -1,7 +1,7 @@
/tmp /tmp
/binaries /binaries
/coverage*.txt /coverage*.txt
/apidocs/*.html /api/*.html
/internal/core/VERSION /internal/core/VERSION
/internal/servers/hls/hls.min.js /internal/servers/hls/hls.min.js
/internal/staticsources/rpicamera/mtxrpicam_*/ /internal/staticsources/rpicamera/mtxrpicam_*/

View File

@@ -2146,7 +2146,7 @@ To obtain a list of of active paths, run:
curl http://127.0.0.1:9997/v3/paths/list curl http://127.0.0.1:9997/v3/paths/list
``` ```
Full documentation of the Control API is available on the [dedicated site](https://bluenviron.github.io/mediamtx/). The control API is documented in the [OpenAPI / Swagger file](api/openapi.yaml) and in a [dedicated site](https://bluenviron.github.io/mediamtx/).
Be aware that by default the Control API is accessible by localhost only; to increase visibility or add authentication, check [Authentication](#authentication). Be aware that by default the Control API is accessible by localhost only; to increase visibility or add authentication, check [Authentication](#authentication).

View File

@@ -33,7 +33,7 @@ type openAPI struct {
} }
func TestAPIDocs(t *testing.T) { func TestAPIDocs(t *testing.T) {
byts, err := os.ReadFile("../../apidocs/openapi.yaml") byts, err := os.ReadFile("../../api/openapi.yaml")
require.NoError(t, err) require.NoError(t, err)
var doc openAPI var doc openAPI

View File

@@ -6,5 +6,5 @@ export DOCKERFILE_APIDOCS_GEN
apidocs: apidocs:
echo "$$DOCKERFILE_APIDOCS_GEN" | docker build . -f - -t temp echo "$$DOCKERFILE_APIDOCS_GEN" | docker build . -f - -t temp
docker run --rm -v "$(shell pwd)/apidocs:/s" -w /s temp \ docker run --rm -v "$(shell pwd)/api:/s" -w /s temp \
sh -c "redoc-cli bundle openapi.yaml" sh -c "redoc-cli bundle openapi.yaml"

View File

@@ -15,7 +15,7 @@ lint-mod-tidy:
lint-apidocs: lint-apidocs:
echo "$$DOCKERFILE_APIDOCS_LINT" | docker build . -f - -t temp echo "$$DOCKERFILE_APIDOCS_LINT" | docker build . -f - -t temp
docker run --rm -v "$(shell pwd)/apidocs:/s" -w /s temp \ docker run --rm -v "$(shell pwd)/api:/s" -w /s temp \
sh -c "openapi lint openapi.yaml" sh -c "openapi lint openapi.yaml"
lint: lint-golangci lint-mod-tidy lint-apidocs lint: lint-golangci lint-mod-tidy lint-apidocs