-
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(server): generate the REST using the OpenAPI spec
With this change, the REST server is now generated based on the OpenAPI spec. This ties up both the definition and the implementation, preventing further deviations and invalid specifications (if it's invalid, it will fail to generate or won't be able to be used inside the server). With this, we can ensure that the OpenAPI consumers will always have the correct definition
- Loading branch information
1 parent
2977c71
commit 0df5768
Showing
14 changed files
with
267 additions
and
252 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,13 @@ fe: | |
dev: | ||
cd frontend && pnpm dev | ||
|
||
all: | ||
gen: | ||
ifeq (, $(shell which ogen)) | ||
go install github.com/ogen-go/ogen/cmd/[email protected] | ||
endif | ||
go generate ./... | ||
|
||
all: gen | ||
$(MAKE) fe && cd .. | ||
CGO_ENABLED=0 go build -o yt-dlp-webui main.go | ||
|
||
|
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
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 |
---|---|---|
@@ -1,9 +1,21 @@ | ||
{ lib }: { | ||
{ lib, pkgs }: { | ||
version = "v3.1.2"; | ||
meta = { | ||
description = "A terrible web ui for yt-dlp. Designed to be self-hosted."; | ||
homepage = "https://github.com/marcopeocchi/yt-dlp-web-ui"; | ||
license = lib.licenses.mpl20; | ||
}; | ||
} | ||
ogen = pkgs.buildGo123Module { | ||
pname = "ogen"; | ||
version = "v1.4.1"; | ||
|
||
src = pkgs.fetchFromGitHub { | ||
owner = "ogen-go"; | ||
repo = "ogen"; | ||
rev = "v1.4.1"; | ||
sha256 = "sha256-SwJY9VQafclAxEQ/cbRJALvMLlnSIItIOz92XzuCoCk="; | ||
}; | ||
|
||
vendorHash = "sha256-IxG7y0Zy0DerCh5DRdSWSaD643BG/8Wj2wuYvkn+XzE="; | ||
}; | ||
} |
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 |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{ inputsFrom ? [ ], mkShell, yt-dlp, nodejs, go }: | ||
{ inputsFrom ? [ ], mkShell, yt-dlp, nodejs, go, lib, pkgs }: | ||
let | ||
common = import ./common.nix { inherit lib; inherit pkgs; }; | ||
in | ||
mkShell { | ||
inherit inputsFrom; | ||
packages = [ | ||
yt-dlp | ||
nodejs | ||
go | ||
common.ogen | ||
]; | ||
} |
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
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,5 @@ | ||
generator: | ||
features: | ||
disable: | ||
- 'paths/client' | ||
- 'ogen/otel' |
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
Oops, something went wrong.